@@ -4316,23 +4316,37 @@ def join(
4316
4316
Parameters
4317
4317
----------
4318
4318
other : Index
4319
+ The other index on which join is performed.
4319
4320
how : {'left', 'right', 'inner', 'outer'}
4320
4321
level : int or level name, default None
4322
+ It is either the integer position or the name of the level.
4321
4323
return_indexers : bool, default False
4324
+ Whether to return the indexers or not for both the index objects.
4322
4325
sort : bool, default False
4323
4326
Sort the join keys lexicographically in the result Index. If False,
4324
4327
the order of the join keys depends on the join type (how keyword).
4325
4328
4326
4329
Returns
4327
4330
-------
4328
4331
join_index, (left_indexer, right_indexer)
4332
+ The new index.
4333
+
4334
+ See Also
4335
+ --------
4336
+ DataFrame.join : Join columns with `other` DataFrame either on index
4337
+ or on a key.
4338
+ DataFrame.merge : Merge DataFrame or named Series objects with a
4339
+ database-style join.
4329
4340
4330
4341
Examples
4331
4342
--------
4332
4343
>>> idx1 = pd.Index([1, 2, 3])
4333
4344
>>> idx2 = pd.Index([4, 5, 6])
4334
4345
>>> idx1.join(idx2, how="outer")
4335
4346
Index([1, 2, 3, 4, 5, 6], dtype='int64')
4347
+ >>> idx1.join(other=idx2, how="outer", return_indexers=True)
4348
+ (Index([1, 2, 3, 4, 5, 6], dtype='int64'),
4349
+ array([ 0, 1, 2, -1, -1, -1]), array([-1, -1, -1, 0, 1, 2]))
4336
4350
"""
4337
4351
other = ensure_index (other )
4338
4352
sort = sort or how == "outer"
0 commit comments