-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: add if_sheet_exists='overlay' to ExcelWriter #42222
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
Conversation
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
This is still under discussion |
(Most of the) Original discussion: #40231 (comment) As back in #40231, I'm +1 on having this as a feature, and even more so since it was identified that PR actually removed the feature in question. |
The original opposition to the 'overwrite'/'write_to': #40231 (comment) |
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.
pls add a release note in 1.4.0 in the enhancements section
can you rebase |
Hello @joeperdefloep! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-11-15 15:26:58 UTC |
I messed up a bit while rebasing and had to force-push. apologies for that :/ |
I really do not understand why the test fails. It says it fails doctests in |
@joeperdefloep - still some docstring issues on the CI. ping if you're not sure how to fix
|
@rhshadrach shuold be good. Small question: these errors you see are definitely because of these lines. I wanted to have only the overlay option as a |
If you click on Details unde the "Some checks were not successful", you can dig into the CI output. |
@joeperdefloep can you merge master and address test failures |
Sorry it took so long.... Done now :) |
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.
Can you add a whatsnew note(this is changing API so should be needed)?
... if_sheet_exists="overlay", | ||
... ) as writer: | ||
... df1.to_excel(writer, sheet_name="Sheet1") | ||
... df2.to_excel(writer, sheet_name="Sheet1", startcol=3) |
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.
does overlay require startrow to be not 1? (e.g should we error if this is not specified)
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.
Without startrow (e.g. startrow=0
) it will overwrite the headers. This could be desired behaviour so I think we should not error.
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.
This is what I would expect - unspecified starts at the very top left corner of the sheet.
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.
lgtm
... if_sheet_exists="overlay", | ||
... ) as writer: | ||
... df1.to_excel(writer, sheet_name="Sheet1") | ||
... df2.to_excel(writer, sheet_name="Sheet1", startcol=3) |
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.
This is what I would expect - unspecified starts at the very top left corner of the sheet.
@joeperdefloep - Can you resolve the conflicts. |
@jreback - friendly ping. |
thanks @joeperdefloep very nice! |
I mainly wanted this functionality myself, and am very open to input :)