Skip to content

Why we cannot use openpyxl to read excel files in pandas? #21099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
reaCodes opened this issue May 17, 2018 · 5 comments
Closed

Why we cannot use openpyxl to read excel files in pandas? #21099

reaCodes opened this issue May 17, 2018 · 5 comments
Labels
Duplicate Report Duplicate issue or pull request Enhancement IO Excel read_excel, to_excel

Comments

@reaCodes
Copy link

When using read_excel to read excel files, I have to install xlrd.
read_excel has parameter engine, but its value only can be None or xlrd.
ExcelWrite can use openpyxl as engine.

Why we cannot use openpyxl to read excel files in pandas? Or whether I can or not?

@chris-b1
Copy link
Contributor

From what I recall this is because 1) xlrd is mature is works well, and 2) openpyxl doesn't support the legacy xls binary format.

Would probably take a pr supporting openpyxl as a reader if there are performance or other benefits

@WillAyd WillAyd added the IO Excel read_excel, to_excel label May 18, 2018
@WillAyd WillAyd added this to the Contributions Welcome milestone Jul 10, 2018
@cloje
Copy link

cloje commented Aug 11, 2018

I will write the PR to add openpyxl as a reader

@WillAyd WillAyd added Enhancement Duplicate Report Duplicate issue or pull request labels Nov 14, 2018
@WillAyd
Copy link
Member

WillAyd commented Nov 14, 2018

Closing as a duplicate of #11499

@WillAyd WillAyd closed this as completed Nov 14, 2018
@Themanwithoutaplan
Copy link
Contributor

@chris-b1 xlrd may be mature but it's XLSX support is limited. For example charts, images, formatting, pivot tables are all supported by openpyxl. xlrd is, at the time of writing, faster but this will change once openpyxl 2.6 is released.

@chris-b1
Copy link
Contributor

Thanks for the color @Themanwithoutaplan - definitely didn't mean to disparage openpyxl, only meant for our purposes (not currently reading any formatting, charts, etc) xlrd works well. If performance is improved in 2.6 definitely would be excited for that as an option!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request Enhancement IO Excel read_excel, to_excel
Projects
None yet
Development

No branches or pull requests

5 participants