ENH: Rename ExcelWriter to make clear attributes are not public
See original GitHub issueRef: https://github.com/pandas-dev/pandas/issues/43068#issuecomment-900504112
Copying from the comment above:
The documentation of
ExcelWriter
says: “None of the methods and properties are considered public.”.
It seems this line the documentation would be easy to miss, and it’d be better to make this more clear via the standard naming convention of a single leading underscore.
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
pandas appending excel(xlsx) file gives attribute.error
First off, things that won't work: From the to_excel docs, "If you wish to write to more than one sheet in the workbook,...
Read more >pandas.ExcelWriter — pandas 1.5.2 documentation
pandas.ExcelWriter# · error: raise a ValueError. · new: Create a new sheet, with a name determined by the engine. · replace: Delete the...
Read more >Advanced Python
We can trap decode and encode errors and/or remove or replace inappropriate characters. Strings and bytestrings do not carry encoding information; this means ......
Read more >'function' object has no attribute 'drop'
AttributeError: 'str' object has no attribute 'append' Python has a special ... Renaming columns in a Pandas DataFrame. ; CREATE: gives ability to...
Read more >KNIME Server Administration Guide
No configuration changes are required. In order to add/remove users, or create/remove groups the administration pages of the WebPortal can be used. The ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’d think the overhead would actually come from large excel files, if I’m understanding correctly (I may not be). My impression is that instead of ExcelWriter, we’d use df.to_excel with mode=‘a’, repeatedly appending to the same file. In the remote case though, instead of committing the file as one operation via the end of the ExcelWriter, we would now write a file (sending it to S3), then open it for append, requiring reading it back (retrieving it from S3), close the file again (sending it back to S3), etc. You’re basically looking at 2n-1 file transfers to make a workbook of n sheets, and need to transfer O(n^2) bytes of data back and forth. If I write a workbook of 15 sheets of 5 MB each I need to transfer 1.1 GB of data. Of course this is true without the remote too, but the perf cost is clearer if you picture the transfer going across a 100 Mbps WAN.
You’re absolutely right about startrow/startcol and the addition of styler.to_excel obviating the need for much of the fancier formatting that used to exist. Conditional formatting in the cells is something I use sometimes in case a downstream recipient wants to add to it, but that is definitely a more niche use case and more suited to an external.
Hmm, I do think it is nice that sheets is a more general form. ODSwriter puts the tables (
sheets
) together inside thesave
function, whereas the others just save the.book
. So that would be different implementations… Still it sounds nice to have indeed sheets be recreated/updated on everey write_cells. Should be possible I think.