@@ -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,43 +6452,38 @@ 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, optional
6455
+ on : str, list of str, or array-like
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` 's index.
6465
+ * right: use other frame 's index.
6466
6466
* outer: form union of calling frame's index (or column if on is
6467
- specified) with ` other` 's index, and sort it.
6467
+ specified) with other frame '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` 's index, preserving the order
6470
+ on is specified) with other frame 's index, preserving the order
6471
6471
of the calling's one.
6472
- lsuffix : str, default ''
6472
+ lsuffix : str
6473
6473
Suffix to use from left frame's overlapping columns.
6474
- rsuffix : str, default ''
6474
+ rsuffix : str
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
-
6485
6480
Notes
6486
6481
-----
6487
- Options `on`, ` lsuffix` , and ` rsuffix` options are not supported
6488
- when passing a list of DataFrame objects.
6482
+ on, lsuffix, and rsuffix options are not supported when passing a list
6483
+ of DataFrame objects
6489
6484
6490
6485
Support for specifying index levels as the `on` parameter was added
6491
- in version 0.23.0.
6486
+ in version 0.23.0
6492
6487
6493
6488
See Also
6494
6489
--------
@@ -6530,7 +6525,7 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
6530
6525
5 K5 A5 NaN NaN
6531
6526
6532
6527
If we want to join using the key columns, we need to set key to be
6533
- the index in both `df` and ` other` . The joined DataFrame will have
6528
+ the index in both df and other. The joined DataFrame will have
6534
6529
key as its index.
6535
6530
6536
6531
>>> df.set_index('key').join(other.set_index('key'))
@@ -6543,9 +6538,9 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
6543
6538
K4 A4 NaN
6544
6539
K5 A5 NaN
6545
6540
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
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
6549
6544
index in the result.
6550
6545
6551
6546
>>> df.join(other.set_index('key'), on='key')
@@ -6556,6 +6551,10 @@ def join(self, other, on=None, how='left', lsuffix='', rsuffix='',
6556
6551
3 K3 A3 NaN
6557
6552
4 K4 A4 NaN
6558
6553
5 K5 A5 NaN
6554
+
6555
+ Returns
6556
+ -------
6557
+ joined : DataFrame
6559
6558
"""
6560
6559
# For SparseDataFrame's benefit
6561
6560
return self ._join_compat (other , on = on , how = how , lsuffix = lsuffix ,
0 commit comments