Skip to content

DOC GH22897 Fix docstring of join in pandas/core/frame.py #22904

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

Closed
wants to merge 8 commits into from
Prev Previous commit
Next Next commit
DOC GH22897 Modified previous commit to use double backticks when app…
…ropriate
  • Loading branch information
JustinZhengBC committed Sep 30, 2018
commit 762f66d9fc802d2d241300cc350c3262865e7526
4 changes: 2 additions & 2 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -6530,7 +6530,7 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
5 K5 A5 NaN NaN

If we want to join using the key columns, we need to set key to be
the index in both `df` and `other`. The joined DataFrame will have
the index in both ``df`` and `other`. The joined DataFrame will have
key as its index.

>>> df.set_index('key').join(other.set_index('key'))
Expand All @@ -6545,7 +6545,7 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',

Another option to join using the key columns is to use the `on`
parameter. DataFrame.join always uses `other`'s index but we can use
any column in `df`. This method preserves the original DataFrame's
any column in ``df``. This method preserves the original DataFrame's
Copy link
Member

Choose a reason for hiding this comment

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

The double backticks is for code, and the single backticks for objects that are being referenced. We don't have an exact convention for things like the parameters or the variables. Can you leave them with single backticks for now, as it's inconsistent to have df with double, and the rest like other with single. Other than that, the PR looks great.

index in the result.

>>> df.join(other.set_index('key'), on='key')
Expand Down