Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

226
Visualizações
Read value from specific cell in specific worksheet

I'm reading in a number of report files to create one dataframe which is working okay

cwd = os.path.abspath('') 
files = os.listdir(cwd)  
col_list = 'column1','column2'

df = pd.DataFrame()
for file in files:
    if file.endswith('.xlsx'):
        d = pd.read_excel(file,'worksheet1', usecols = col_list)
        df = df.append(d, ignore_index=True) 

The date that each file was created is stored in the same file but in a different sheet in cell B3. I'd like to add this value as a new column to each record for that file.

I've tried using .cell(row,column) as so:-

df = pd.DataFrame()
for file in files:
    if file.endswith('.xlsx'):
        d = pd.read_excel(file,'worksheet1', usecols = col_list)
        d['value'] = 'worksheet2'.cell(3,2)
        df = df.append(d, ignore_index=True)

but get the error AttributeError: 'str' object has no attribute 'cell'

about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda