79825872

Date: 2025-11-20 19:07:56
Score: 1
Natty:
Report link

Normally reading all cells as strings should do the trick

For sure the closed bracket ) behind sheet_name=None is wrong in you code


df_25_dict = pd.read_excel(2025_data, sheet_name=None),
    dtype={
        'bg_code': str,
        'tranx_date_year': str,
        'journal_number': str,
        'journal_line_number': str,
        'prj_code': str
    },
    parse_dates=['tranx_date', 'entry_date'])

Alternatively there is also the converters argument in Pandas read_excel() to control data type conversion better

https://pandas.pydata.org/docs/reference/api/pandas.read_excel.html

Python pandas: how to specify data types when reading an Excel file?

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-1):
Posted by: ralf htp