Skip to content

BUG: read_excel fails when empty sheets exist and sheetname=None #11711 #11819

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

Merged
merged 1 commit into from
Dec 12, 2015

Conversation

sxwang
Copy link
Contributor

@sxwang sxwang commented Dec 11, 2015

Fixes issue #11711.

Existing code prematurely returns an empty dataframe when an empty sheet in the source excel file is encountered.
Fix is to store an empty dataframe in the output dict and continue to the next sheet.

@jreback jreback added Bug IO Excel read_excel, to_excel Compat pandas objects compatability with Numpy or Python functions labels Dec 11, 2015
@@ -197,3 +197,5 @@ Bug Fixes
- Bug in ``pd.rolling_median`` where memory allocation failed even with sufficient memory (:issue:`11696`)

- Bug in ``df.replace`` while replacing value in mixed dtype ``Dataframe`` (:issue:`11698`)

- Bug in ``read_excel`` failing to read any non-empty sheets when empty sheets exist and sheetname=None (:issue:`11711`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use double backticks around sheetname=None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@jreback
Copy link
Contributor

jreback commented Dec 11, 2015

does this cover both cases in #11711 (IIRC blank sheet in middle was ok, at end was buggy)

but was there another case?

@jreback jreback added this to the 0.18.0 milestone Dec 11, 2015
@sxwang
Copy link
Contributor Author

sxwang commented Dec 11, 2015

This should cover cases where blank sheets are anywhere in the excel file, including in the middle, as stated in the #11711 comment.

@jreback
Copy link
Contributor

jreback commented Dec 11, 2015

ok lgtm. ping when green.

@sxwang
Copy link
Contributor Author

sxwang commented Dec 11, 2015

build done & green

jreback added a commit that referenced this pull request Dec 12, 2015
BUG: read_excel fails when empty sheets exist and sheetname=None #11711
@jreback jreback merged commit 4979f7a into pandas-dev:master Dec 12, 2015
@jreback
Copy link
Contributor

jreback commented Dec 12, 2015

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Compat pandas objects compatability with Numpy or Python functions IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants