PacktPublishing / Python-Data-Cleaning-Cookbook

Python Data Cleaning Cookbook, published by Packt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Latest xlrd doesn't support xlsx anymore

horzsolt opened this issue · comments

Pandas default Excel engine xlrd starting from its most recent 2.0.0 version doesn't support xlsx format:
https://xlrd.readthedocs.io/en/latest/changes.html#id1
An alternative engine should be used, like openpyxl:
percapitaGDP = pd.read_excel("data/GDPpercapita.xlsx", sheet_name="OECD.Stat export", engine='openpyxl', skiprows=4, skipfooter=1, usecols="A,C:T")

Thanks for informing and also providing a workaround