Home > Blockchain >  Converting .xlsb to .xlsx using pandas changes dates to random numbers
Converting .xlsb to .xlsx using pandas changes dates to random numbers

Time:06-29

I have a .xlsb document that I'm converting to .xlsx using this:

df = read_excel('excels/TEF.xlsb, engine = 'pyxlsb')

df.to_excel('.\excels\TEF.xlsx')

Conversion(albeit slow) works for everything except dates.

.xlsx and .xlsb files side by side

Left side is the converted .xlsx file, right side is the original .xlsb file.

As you can see the converted file has random numbers instead of dates.

Any ideas why this happens, and how can I convert .xlsx file to .xlsb file using python/pandas or any other library?

CodePudding user response:

These "random numbers" are days since 01.01.1900. You wil have to convert them after loading the xlsb.

  • Related