diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 7e4c7cb527a62..da0d98eff5e46 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -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" \ diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 3952503581bba..048362a28dfd7 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -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])