-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC:add append example in to_excel documentation #27852
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
pandas/core/generic.py
Outdated
|
||
>>> with pd.ExcelWriter('the_existing_file.xlsx', engine='openpyxl', | ||
... mode='a') as writer: | ||
... df.to_excel(writer) |
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 example feels disconnected with the rest of the docstring.
I'd move it to line 2181, and say something like ExcelWriter can also be used to append to an existing Excel file
. And then use the same file output.xlsx
and append a sheet Sheet_name_3
. I think that will be much clearer.
You also need the # doctest: +SKIP
as in the other examples.
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.
Yeah. You are right. That will be clearer. Will make the required change
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, thanks for taking care of this @sameshl
Merged master to hopefully fix CI. Ping on green. |
@TomAugspurger Looks good now! |
Thanks @sameshl If there is something broken in master (e.g. a pandas dependency has been updated and it causes a test to fail), then all PRs will fail even if they are correct. So, master needs to be fixed first, and then the fixes in master need to be merged into the PRs that failed. |
@datapythonista Thanks for the explanation! |
closes #27051