-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: read_excel with openpyxl produces trailing rows of nan #39547
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
BUG: read_excel with openpyxl produces trailing rows of nan #39547
Conversation
…enpyxl_header � Conflicts: � doc/source/whatsnew/v1.2.2.rst
why is this not an upstream bug? (not averse to fixing in pandas at least tactically). |
We could fix this issue by calling |
ok! yeah as long as its robust ok with this |
data = data[: last_row_with_data + 1] | ||
|
||
# With dimension reset, openpyxl no longer pads rows | ||
max_width = max(len(data_row) for data_row in data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With some xlsx files I get an error:
max() arg is an empty sequence
I am pretty sure this happens when data object is empty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't share the file but I can tell it starts with empty rows and empty columns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - thanks for catching this!
…enpyxl_workbook
…enpyxl_workbook � Conflicts: � doc/source/whatsnew/v1.2.2.rst � pandas/tests/io/excel/test_openpyxl.py
…enpyxl_nans � Conflicts: � pandas/io/excel/_openpyxl.py � pandas/tests/io/excel/test_openpyxl.py
lgtm. @simonjayhawkins prob worth doing for 1.2.2 |
sure |
…enpyxl_nans � Conflicts: � pandas/tests/io/excel/test_openpyxl.py
hmm is this a suprious issue on the ci / checks? |
numpydoc failure is also happening on master, so unrelated |
@meeseeksdev backport 1.2.x |
…trailing rows of nan
…ows of nan (#39679) Co-authored-by: Richard Shadrach <[email protected]>
This is on top of #39486