Skip to content

Commit 8139490

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

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

pandas/core/frame.py

+21-20
Original file line numberDiff line numberDiff line change
@@ -6442,8 +6442,8 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
64426442
"""
64436443
Join columns of another DataFrame.
64446444
6445-
Join columns with other DataFrame either on index or on a key
6446-
column. Efficiently Join multiple DataFrame objects by index at once by
6445+
Join columns with `other` DataFrame either on index or on a key
6446+
column. Efficiently join multiple DataFrame objects by index at once by
64476447
passing a list.
64486448
64496449
Parameters
@@ -6452,38 +6452,43 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
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 : str, list of str, or array-like
6455+
on : str, list of str, or array-like, optional
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
64596459
pass an array as the join key if it is not already contained in
64606460
the calling DataFrame. Like an Excel VLOOKUP operation.
6461-
how : {'left', 'right', 'outer', 'inner'}, default: 'left'
6461+
how : {'left', 'right', 'outer', 'inner'}, default 'left'
64626462
How to handle the operation of the two objects.
64636463
64646464
* left: use calling frame's index (or column if on is specified)
6465-
* right: use other frame's index.
6465+
* right: use `other`'s index.
64666466
* outer: form union of calling frame's index (or column if on is
6467-
specified) with other frame's index, and sort it.
6467+
specified) with `other`'s index, and sort it.
64686468
lexicographically.
64696469
* inner: form intersection of calling frame's index (or column if
6470-
on is specified) with other frame's index, preserving the order
6470+
on is specified) with `other`'s index, preserving the order
64716471
of the calling's one.
6472-
lsuffix : str
6472+
lsuffix : str, default ''
64736473
Suffix to use from left frame's overlapping columns.
6474-
rsuffix : str
6474+
rsuffix : str, default ''
64756475
Suffix to use from right frame's overlapping columns.
64766476
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
6480+
Returns
6481+
-------
6482+
DataFrame
6483+
A dataframe containing columns from both the caller and `other`.
6484+
64806485
Notes
64816486
-----
6482-
on, lsuffix, and rsuffix options are not supported when passing a list
6483-
of DataFrame objects
6487+
Options `on`, `lsuffix`, and `rsuffix` options are not supported
6488+
when passing a list of DataFrame objects.
64846489
64856490
Support for specifying index levels as the `on` parameter was added
6486-
in version 0.23.0
6491+
in version 0.23.0.
64876492
64886493
See Also
64896494
--------
@@ -6525,7 +6530,7 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
65256530
5 K5 A5 NaN NaN
65266531
65276532
If we want to join using the key columns, we need to set key to be
6528-
the index in both df and other. The joined DataFrame will have
6533+
the index in both `df` and `other`. The joined DataFrame will have
65296534
key as its index.
65306535
65316536
>>> df.set_index('key').join(other.set_index('key'))
@@ -6538,9 +6543,9 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
65386543
K4 A4 NaN
65396544
K5 A5 NaN
65406545
6541-
Another option to join using the key columns is to use the on
6542-
parameter. DataFrame.join always uses other's index but we can use any
6543-
column in df. This method preserves the original DataFrame's
6546+
Another option to join using the key columns is to use the `on`
6547+
parameter. DataFrame.join always uses `other`'s index but we can use
6548+
any column in `df`. This method preserves the original DataFrame's
65446549
index in the result.
65456550
65466551
>>> df.join(other.set_index('key'), on='key')
@@ -6551,10 +6556,6 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
65516556
3 K3 A3 NaN
65526557
4 K4 A4 NaN
65536558
5 K5 A5 NaN
6554-
6555-
Returns
6556-
-------
6557-
joined : DataFrame
65586559
"""
65596560
# For SparseDataFrame's benefit
65606561
return self._join_compat(other, on=on, how=how, lsuffix=lsuffix,

0 commit comments

Comments
 (0)