-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
to_excel cannot handle large sheet #26051
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
Comments
A little strange that nothing happens on the xlsxwriter side, but yes would definitely take a PR that guards and raises on our end |
I think this makes more sense as an enhancement request for xlsxwriter that would just pass through here rather than doing it on our end |
I'm new to pandas-dev. Does the closed tag on the feature request I see above indicate the work is already done and this entire issue should be closed? |
I think we could handle on the pandas side - Xlsxwriter's interface is essentially cell-based - there isn't a way to know in advance if those limits are going to be broken. Because pandas know the total table size in advance, I think it makes sense to check and raise. |
I agree @chris-b1. I assume this hasn't been addressed, but I'm uncertain due to the red "Closed" indicator I see beside the feature request above my original comment. |
That closed is from the linked issue in the xlsxwriter repo |
Ah, makes sense. Thank you! |
Going to raise a ValueError unless anyone has a better suggestion. |
I believe xlsx writer hangs when passed a sheet that is too large. I test whether calling df.to_excel raises a ValueError when given a sheet that is too large. In that case, the test passes. However, if too large of a sheet is passed, and the code to check input size is not there, the to_excel call will hang resulting in the test stalling. Any ideas on how to best proceed? I believe the best course would be to ignore testing the new checking logic, because adding the test I previously described would just add unhelpful code. |
Solved. |
@anordin95, it still fails,
Any suggestions on increasing the limit to say |
This looks like it should fail. The maximum sheet size in excel is being exceeded. You have ~1.2M rows and excel can only handle ~1M. I'm not sure what m/m means. Writing your data to another format may better suit your usage, such as hdf. |
Had the UK's public health system seen this issue... |
is there a way to auto add new sheet in pandas.ExcelWriter if a sheet reaches maximum limit? |
Problem description
For extremely large sheets (row_num > 1048576, col_num > 16384), see the code of XlsxWriter Engine, area which exceeds the limit won't be printed.
However, no error or warning is raised.
Expected Output
This sheet is too large! Area off (1048576, 1638) will not be printed.
Output of
pd.show_versions()
latest (v0.24.2)
The text was updated successfully, but these errors were encountered: