Skip to content

DOC: Improve code example for DataFrame.join #44735

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 3 commits into from
Dec 4, 2021

Conversation

ChristofKaufmann
Copy link
Contributor

The modified code example does not have unique values in the 'key' column in the calling DataFrame df. With unique keys the special behavior of join has not been highlighted, since it just added a new column. With the modified values the example shows that the 'key' column is really used as key.

The modified code example does not have unique values in the 'key' column in the calling DataFrame `df`. With unique keys the special behavior of `join` has not been highlighted, since it just added a new column. With the modified values the example shows that the 'key' column is really used as key.
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.

Could you keep the original example and add a new one instead?

@ChristofKaufmann
Copy link
Contributor Author

OK, should I add it for all calls or just with the last and maybe most interesting call, i. e. df.join(other.set_index('key'), on='key')?

@phofl
Copy link
Member

phofl commented Dec 3, 2021

I think the last one is enough

@jreback jreback added this to the 1.4 milestone Dec 3, 2021
@jreback jreback added Docs Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Dec 3, 2021
This adds back the original example and adds the new example as an additional one.
@pep8speaks
Copy link

pep8speaks commented Dec 4, 2021

Hello @ChristofKaufmann! 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-12-04 00:58:08 UTC

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.

lgtm

@jreback jreback merged commit 9198f35 into pandas-dev:master Dec 4, 2021
@jreback
Copy link
Contributor

jreback commented Dec 4, 2021

thanks @ChristofKaufmann

@ChristofKaufmann
Copy link
Contributor Author

Thank you!

@ChristofKaufmann ChristofKaufmann deleted the improve-join-example branch December 5, 2021 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants