The read_excel() method can read Excel 2003 (.xls) files using the xlrd Python module. Excel 2007+ (.xlsx) files can be read using either xlrd or openpyxl. Binary Excel (.xlsb) files can be read using pyxlsb. The to_excel() instance method is used for saving a DataFrame to Excel. Generally the semantics are similar to working with csv data. See the cookbook for some advanced strategies.
xlrd is a library for reading data and formatting information from Excel files, whether they are .xls or .xlsx files.
pip install xlrd solved the problem.
Maybe also install xlwt openpyxl xlsxwriter if other actions required.
pip install xlrd
solved the problem.Maybe also install xlwt openpyxl xlsxwriter if other actions required.
ImportError不是提示缺少xlrd依赖库么。安装一下应该就可以解决了。
照我所看,有可能是还没安装xlrd,在cmd输入
pip3 install xlrd
然后在jupyter里面
import xlrd
如果我没记错是要这样,我自己是读csv 的,所以显示的时候会使用pandas显示,然后再使用matplotlib工具画图
首先查看你 pip 对应的 site-package:
!pip3 -V
然后!pip3 list
会发现没有xlrd
之后安装这个!pip3 install xlrd
然后在代码块前面加上import xlrd
可以的话,请单击 “最佳解决方案” 以表示问题已解决! : )