Python: Pandas pd.read_excel giving ImportError: Install xlrd >= 0.9.0 for Excel support

前端 未结 15 2138
太阳男子
太阳男子 2021-02-01 12:04

I am trying to read a .xlsx with pandas, but get the follwing error:

data = pd.read_excel(low_memory=False, io=\"DataAnalysis1/temp1.xlsx\").fillna(         


        
15条回答
  •  春和景丽
    2021-02-01 12:11

    Since December 2020 xlrd no longer supports xlsx-Files as explained in the official changelog. You can use openpyxl instead:

    pip install openpyxl
    

    And in your python-file:

    import pandas as pd
    pd.read_excel('path/to/file.xlsx', engine='openpyxl')
    

提交回复
热议问题