Skip to content

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

Merged
merged 7 commits into from
May 17, 2021

Conversation

t0asty
Copy link
Contributor

@t0asty t0asty commented May 12, 2021

Change index to [0, 2] to stress that ignore_index=True resets the index of both dataframes

Test Output:

################################################################################
################################## Validation ##################################
################################################################################

1 Errors found:
	Return value has no description

t0asty added 2 commits May 12, 2021 23:06
…v#41407

Change index to [0, 2] to stress that ignore_index=True resets the index of both dataframes
Copy link
Member

@phofl phofl left a 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

@lithomas1 lithomas1 added the Docs label May 13, 2021
@lithomas1 lithomas1 added this to the 1.3 milestone May 13, 2021
@t0asty t0asty requested a review from phofl May 13, 2021 07:56
Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks very much

@t0asty
Copy link
Contributor Author

t0asty commented May 13, 2021

Anything to fix? Sounds not like it's coming from my changes, does it?

Sphinx parallel build error: nbsphinx.NotebookError: UndefinedError in user_guide/style.ipynb: 'nbformat.notebooknode.NotebookNode object' has no attribute 'tags'

@phofl
Copy link
Member

phofl commented May 13, 2021

No, see #41450

@phofl phofl closed this May 13, 2021
@phofl phofl reopened this May 13, 2021
@phofl
Copy link
Member

phofl commented May 13, 2021

Sorry pressed the wrong button, this was not on purpose

Copy link
Member

@datapythonista datapythonista left a 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.

@datapythonista
Copy link
Member

Btw, if you merge maser, the CI should be fixed.

@datapythonista datapythonista changed the title #41407 update example df.append DOC: Improve examples of df.append to better show the ignore_index param May 13, 2021
@datapythonista
Copy link
Member

Another btw, feel free to add the Return description, since the validation is complaining that one is missing, and should be very easy to add.

Copy link
Contributor

@attack68 attack68 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very minor comment

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @t0asty, lgtm

@t0asty t0asty requested a review from attack68 May 17, 2021 07:59
@jreback jreback merged commit bb5bfa6 into pandas-dev:master May 17, 2021
@jreback
Copy link
Contributor

jreback commented May 17, 2021

thanks @t0asty

TLouf pushed a commit to TLouf/pandas that referenced this pull request Jun 1, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Unclear first example in pandas.DataFrame.append
6 participants