Skip to content

Commit 988c40c

Browse files
committed
DOC GH22897 Fix other formatting issues in pandas/core/frame.py
1 parent cf56698 commit 988c40c

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

pandas/core/frame.py

+17-18
Original file line numberDiff line numberDiff line change
@@ -6440,19 +6440,19 @@ def append(self, other, ignore_index=False,
64406440
def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
64416441
sort=False):
64426442
"""
6443-
Append columns of another DataFrame.
6443+
Join columns of another DataFrame.
64446444
64456445
Join columns with other DataFrame either on index or on a key
64466446
column. Efficiently Join multiple DataFrame objects by index at once by
64476447
passing a list.
64486448
64496449
Parameters
64506450
----------
6451-
other : DataFrame, Series with name field set, or list of DataFrame
6451+
other : DataFrame, Series, or list of DataFrame
64526452
Index should be similar to one of the columns in this one. If a
64536453
Series is passed, its name attribute must be set, and that will be
64546454
used as the column name in the resulting joined DataFrame.
6455-
on : name, tuple/list of names, or array-like
6455+
on : str, list of str, or array-like
64566456
Column or index level name(s) in the caller to join on the index
64576457
in `other`, otherwise joins index-on-index. If multiple
64586458
values given, the `other` DataFrame must have a MultiIndex. Can
@@ -6469,11 +6469,11 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
64696469
* inner: form intersection of calling frame's index (or column if
64706470
on is specified) with other frame's index, preserving the order
64716471
of the calling's one.
6472-
lsuffix : string
6472+
lsuffix : str
64736473
Suffix to use from left frame's overlapping columns.
6474-
rsuffix : string
6474+
rsuffix : str
64756475
Suffix to use from right frame's overlapping columns.
6476-
sort : boolean, default False
6476+
sort : bool, default False
64776477
Order result DataFrame lexicographically by the join key. If False,
64786478
the order of the join key depends on the join type (how keyword).
64796479
@@ -6485,14 +6485,17 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
64856485
Support for specifying index levels as the `on` parameter was added
64866486
in version 0.23.0
64876487
6488+
See Also
6489+
--------
6490+
DataFrame.merge : For column(s)-on-columns(s) operations.
6491+
64886492
Examples
64896493
--------
6490-
>>> import pandas as pd
64916494
6492-
>>> caller = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3', 'K4', 'K5'],
6495+
>>> df = pd.DataFrame({'key': ['K0', 'K1', 'K2', 'K3', 'K4', 'K5'],
64936496
... 'A': ['A0', 'A1', 'A2', 'A3', 'A4', 'A5']})
64946497
6495-
>>> caller
6498+
>>> df
64966499
key A
64976500
0 K0 A0
64986501
1 K1 A1
@@ -6512,7 +6515,7 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
65126515
65136516
Join DataFrames using their indexes.
65146517
6515-
>>> caller.join(other, lsuffix='_caller', rsuffix='_other')
6518+
>>> df.join(other, lsuffix='_caller', rsuffix='_other')
65166519
key_caller A key_other B
65176520
0 K0 A0 K0 B0
65186521
1 K1 A1 K1 B1
@@ -6522,10 +6525,10 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
65226525
5 K5 A5 NaN NaN
65236526
65246527
If we want to join using the key columns, we need to set key to be
6525-
the index in both caller and other. The joined DataFrame will have
6528+
the index in both df and other. The joined DataFrame will have
65266529
key as its index.
65276530
6528-
>>> caller.set_index('key').join(other.set_index('key'))
6531+
>>> df.set_index('key').join(other.set_index('key'))
65296532
A B
65306533
key
65316534
K0 A0 B0
@@ -6537,10 +6540,10 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
65376540
65386541
Another option to join using the key columns is to use the on
65396542
parameter. DataFrame.join always uses other's index but we can use any
6540-
column in the caller. This method preserves the original caller's
6543+
column in df. This method preserves the original DataFrame's
65416544
index in the result.
65426545
6543-
>>> caller.join(other.set_index('key'), on='key')
6546+
>>> df.join(other.set_index('key'), on='key')
65446547
key A B
65456548
0 K0 A0 B0
65466549
1 K1 A1 B1
@@ -6549,10 +6552,6 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
65496552
4 K4 A4 NaN
65506553
5 K5 A5 NaN
65516554
6552-
See also
6553-
--------
6554-
DataFrame.merge : For column(s)-on-columns(s) operations
6555-
65566555
Returns
65576556
-------
65586557
joined : DataFrame

0 commit comments

Comments
 (0)