html - Python df.to_excel() storing numbers as text in excel. How to store as Value? - Stack Overflow

PHOTO EMBED

Tue Jan 18 2022 06:21:42 GMT+0000 (Coordinated Universal Time)

Saved by [deleted user]

# Versions of Pandas >= 1.3.0:
writer = pd.ExcelWriter('output.xlsx',
                        engine='xlsxwriter',
                        engine_kwargs={'options': {'strings_to_numbers': True}})

# Versions of Pandas < 1.3.0:
writer = pd.ExcelWriter('output.xlsx',
                        engine='xlsxwriter',
                        options={'strings_to_numbers': True})
content_copyCOPY

https://stackoverflow.com/questions/41080999/python-df-to-excel-storing-numbers-as-text-in-excel-how-to-store-as-value