-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Improve examples of df.append to better show the ignore_index param #41444
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
DOC: Improve examples of df.append to better show the ignore_index param #41444
Conversation
…v#41407 Change index to [0, 2] to stress that ignore_index=True resets the index of both dataframes
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.
Small comment, otherwise lgtm
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.
Thanks very much
Anything to fix? Sounds not like it's coming from my changes, does it?
|
No, see #41450 |
Sorry pressed the wrong button, this was not on purpose |
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.
Being honest, I find the original example clearer and more realistic. I think in most cases users will experience appending or concatenating dataframes that both have the default index and start with 0
. And ignore_index
will be used to get a new default index for both together. That's what the original example illustrates, I find this new one a bit arbitrary.
Not against merging this if other people find it more clear. But if you think the example it's not clear, maybe using meaningful data would make more sense than this change. Like finding two dataframes that the users can relate with and make sense appending. We have some examples with animals, and their number of legs, their maximum speed... And some others that are not just random data.
Btw, if you merge maser, the CI should be fixed. |
Another btw, feel free to add the |
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.
very minor 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.
Thanks @t0asty, lgtm
thanks @t0asty |
Change index to [0, 2] to stress that ignore_index=True resets the index of both dataframes
Test Output: