pandas无法打开.xlsx文件,xlrd.biffh.XLRDError: Excel xlsx file; not supported
生活随笔
收集整理的這篇文章主要介紹了
pandas无法打开.xlsx文件,xlrd.biffh.XLRDError: Excel xlsx file; not supported
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
pandas無法打開.xlsx文件,xlrd.biffh.XLRDError: Excel xlsx file; not supported
新版xlrd報 Excel xlsx file; not supported
原因是最近xlrd更新到了2.0.1版本,只支持.xls文件。所以pandas.read_excel(‘xxx.xlsx’)會報錯。
可以安裝舊版xlrd,在cmd中運行:
pip uninstall xlrd
pip install xlrd==1.2.0
也可以用openpyxl代替xlrd打開.xlsx文件:
df=pandas.read_excel(‘data.xlsx’,engine=‘openpyxl’)
總結
以上是生活随笔為你收集整理的pandas无法打开.xlsx文件,xlrd.biffh.XLRDError: Excel xlsx file; not supported的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 工厂模式解耦---控制反转
- 下一篇: 测试boot库下I/O模型类型