Home > Blockchain >  pandas read_excel does not work for some reason
pandas read_excel does not work for some reason

Time:10-07

So I'm just trying to read a pretty normal .xlsx file with pandas but for some reason it doesn't work. First of all I do not get any errors, just this warning:

UserWarning: Workbook contains no default style, apply openpyxl's default warn("Workbook contains no default style, apply openpyxl's default")

I've tried specifying the engine to openpyxl and the sheet name but neither one fixed the problem. I really don't know what's the problem since the code is just one line:

df = pd.read_excel('data/RESULT_LIST_ANONYM_ENERGY_MARKET_aFRR_2021-12-01_2021-12-31.xlsx')

Here are the versions of my packages that might be interesting:

  • pandas: 1.5.0
  • openpyxl: 3.0.10

CodePudding user response:

Try this:

df = pd.read_excel('data/RESULT_LIST_ANONYM_ENERGY_MARKET_aFRR_2021-12-01_2021-12-31.xlsx',engine='openpyxl')

CodePudding user response:

ok so I put a print into line 90 of openpyxl->worksheet->_read_only.py to see the progress and it seems like the file was just way bigger than I thought and it just takes like half a minute to read the whole table.

  • Related