Skip to content

Commit

Permalink
DOC: Enforce Numpy Docstring Validation for pandas.Index.get_indexer_…
Browse files Browse the repository at this point in the history
…for (#58507)

* DOC: add PR01,SA01 in pandas.Index.get_indexer_for

* DOC: remove PR01,SA01 in pandas.Index.get_indexer_for
  • Loading branch information
tuhinsharma121 authored May 1, 2024
1 parent 8cc036c commit d276709
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.DataFrame.var PR01,RT03,SA01" \
-i "pandas.Grouper PR02" \
-i "pandas.Index PR07" \
-i "pandas.Index.get_indexer_for PR01,SA01" \
-i "pandas.Index.get_loc PR07,RT03,SA01" \
-i "pandas.Index.join PR07,RT03,SA01" \
-i "pandas.Index.names GL08" \
Expand Down
12 changes: 12 additions & 0 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5953,11 +5953,23 @@ def get_indexer_for(self, target) -> npt.NDArray[np.intp]:
This dispatches to get_indexer or get_indexer_non_unique
as appropriate.
Parameters
----------
target : Index
An iterable containing the values to be used for computing indexer.
Returns
-------
np.ndarray[np.intp]
List of indices.
See Also
--------
Index.get_indexer : Computes indexer and mask for new index given
the current index.
Index.get_non_unique : Returns indexer and masks for new index given
the current index.
Examples
--------
>>> idx = pd.Index([np.nan, "var1", np.nan])
Expand Down

0 comments on commit d276709

Please sign in to comment.