Skip to content

Commit 334a77b

Browse files
tuhinsharma121pmhatre1
authored andcommitted
DOC: Enforce Numpy Docstring Validation for pandas.Index.join (pandas-dev#58560)
* DOC: add PR07,RT03,SA01 for pandas.Index.join * DOC: remove PR07,RT03,SA01 for pandas.Index.join * DOC: add PR07,RT03,SA01 for pandas.Index.join * DOC: fix example output
1 parent 8d8ed22 commit 334a77b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7979
-i "pandas.DataFrame.swaplevel SA01" \
8080
-i "pandas.Grouper PR02" \
8181
-i "pandas.Index PR07" \
82-
-i "pandas.Index.join PR07,RT03,SA01" \
8382
-i "pandas.Index.ravel PR01,RT03" \
8483
-i "pandas.Interval PR02" \
8584
-i "pandas.IntervalIndex.closed SA01" \

pandas/core/indexes/base.py

+14
Original file line numberDiff line numberDiff line change
@@ -4316,23 +4316,37 @@ def join(
43164316
Parameters
43174317
----------
43184318
other : Index
4319+
The other index on which join is performed.
43194320
how : {'left', 'right', 'inner', 'outer'}
43204321
level : int or level name, default None
4322+
It is either the integer position or the name of the level.
43214323
return_indexers : bool, default False
4324+
Whether to return the indexers or not for both the index objects.
43224325
sort : bool, default False
43234326
Sort the join keys lexicographically in the result Index. If False,
43244327
the order of the join keys depends on the join type (how keyword).
43254328
43264329
Returns
43274330
-------
43284331
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.
43294340
43304341
Examples
43314342
--------
43324343
>>> idx1 = pd.Index([1, 2, 3])
43334344
>>> idx2 = pd.Index([4, 5, 6])
43344345
>>> idx1.join(idx2, how="outer")
43354346
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]))
43364350
"""
43374351
other = ensure_index(other)
43384352
sort = sort or how == "outer"

0 commit comments

Comments
 (0)