Skip to content

DOC: Enforce Numpy Docstring Validation for pandas.Index.join #58560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.DataFrame.swaplevel SA01" \
-i "pandas.Grouper PR02" \
-i "pandas.Index PR07" \
-i "pandas.Index.join PR07,RT03,SA01" \
-i "pandas.Index.ravel PR01,RT03" \
-i "pandas.Interval PR02" \
-i "pandas.IntervalIndex.closed SA01" \
Expand Down
14 changes: 14 additions & 0 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4316,23 +4316,37 @@ def join(
Parameters
----------
other : Index
The other index on which join is performed.
how : {'left', 'right', 'inner', 'outer'}
level : int or level name, default None
It is either the integer position or the name of the level.
return_indexers : bool, default False
Whether to return the indexers or not for both the index objects.
sort : bool, default False
Sort the join keys lexicographically in the result Index. If False,
the order of the join keys depends on the join type (how keyword).
Returns
-------
join_index, (left_indexer, right_indexer)
The new index.
See Also
--------
DataFrame.join : Join columns with `other` DataFrame either on index
or on a key.
DataFrame.merge : Merge DataFrame or named Series objects with a
database-style join.
Examples
--------
>>> idx1 = pd.Index([1, 2, 3])
>>> idx2 = pd.Index([4, 5, 6])
>>> idx1.join(idx2, how="outer")
Index([1, 2, 3, 4, 5, 6], dtype='int64')
>>> idx1.join(other=idx2, how="outer", return_indexers=True)
(Index([1, 2, 3, 4, 5, 6], dtype='int64'),
array([ 0, 1, 2, -1, -1, -1]), array([-1, -1, -1, 0, 1, 2]))
"""
other = ensure_index(other)
sort = sort or how == "outer"
Expand Down
Loading