Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

227
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda