@@ -6442,8 +6442,8 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
6442
6442
"""
6443
6443
Join columns of another DataFrame.
6444
6444
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
6447
6447
passing a list.
6448
6448
6449
6449
Parameters
@@ -6452,38 +6452,43 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
6452
6452
Index should be similar to one of the columns in this one. If a
6453
6453
Series is passed, its name attribute must be set, and that will be
6454
6454
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
6456
6456
Column or index level name(s) in the caller to join on the index
6457
6457
in `other`, otherwise joins index-on-index. If multiple
6458
6458
values given, the `other` DataFrame must have a MultiIndex. Can
6459
6459
pass an array as the join key if it is not already contained in
6460
6460
the calling DataFrame. Like an Excel VLOOKUP operation.
6461
- how : {'left', 'right', 'outer', 'inner'}, default: 'left'
6461
+ how : {'left', 'right', 'outer', 'inner'}, default 'left'
6462
6462
How to handle the operation of the two objects.
6463
6463
6464
6464
* 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.
6466
6466
* 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.
6468
6468
lexicographically.
6469
6469
* 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
6471
6471
of the calling's one.
6472
- lsuffix : str
6472
+ lsuffix : str, default ''
6473
6473
Suffix to use from left frame's overlapping columns.
6474
- rsuffix : str
6474
+ rsuffix : str, default ''
6475
6475
Suffix to use from right frame's overlapping columns.
6476
6476
sort : bool, default False
6477
6477
Order result DataFrame lexicographically by the join key. If False,
6478
6478
the order of the join key depends on the join type (how keyword).
6479
6479
6480
+ Returns
6481
+ -------
6482
+ DataFrame
6483
+ A dataframe containing columns from both the caller and `other`.
6484
+
6480
6485
Notes
6481
6486
-----
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.
6484
6489
6485
6490
Support for specifying index levels as the `on` parameter was added
6486
- in version 0.23.0
6491
+ in version 0.23.0.
6487
6492
6488
6493
See Also
6489
6494
--------
@@ -6525,7 +6530,7 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
6525
6530
5 K5 A5 NaN NaN
6526
6531
6527
6532
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
6529
6534
key as its index.
6530
6535
6531
6536
>>> df.set_index('key').join(other.set_index('key'))
@@ -6538,9 +6543,9 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
6538
6543
K4 A4 NaN
6539
6544
K5 A5 NaN
6540
6545
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
6544
6549
index in the result.
6545
6550
6546
6551
>>> df.join(other.set_index('key'), on='key')
@@ -6551,10 +6556,6 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
6551
6556
3 K3 A3 NaN
6552
6557
4 K4 A4 NaN
6553
6558
5 K5 A5 NaN
6554
-
6555
- Returns
6556
- -------
6557
- joined : DataFrame
6558
6559
"""
6559
6560
# For SparseDataFrame's benefit
6560
6561
return self ._join_compat (other , on = on , how = how , lsuffix = lsuffix ,
0 commit comments