From e9d5115c04c1de72a308e14bef29398b9a966bf1 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Wed, 1 May 2024 10:50:31 +0530 Subject: [PATCH 1/2] DOC: add PR01,SA01 in pandas.Index.get_indexer_for --- pandas/core/indexes/base.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 054f522e7a37b..19d17d7d345ec 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -5929,11 +5929,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]) From ddd927f68ab03f80a3bf0e81385f503dcb7ca0d5 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Wed, 1 May 2024 10:51:20 +0530 Subject: [PATCH 2/2] DOC: remove PR01,SA01 in pandas.Index.get_indexer_for --- ci/code_checks.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index f49bfb1581332..a57a664e820c2 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -88,7 +88,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Grouper PR02" \ -i "pandas.Index PR07" \ -i "pandas.Index.get_indexer PR07,SA01" \ - -i "pandas.Index.get_indexer_for PR01,SA01" \ -i "pandas.Index.get_indexer_non_unique PR07,SA01" \ -i "pandas.Index.get_loc PR07,RT03,SA01" \ -i "pandas.Index.join PR07,RT03,SA01" \