From ef0d1a853d124c83c1cac6424e8f35cb13c79f0b Mon Sep 17 00:00:00 2001 From: tuhinsharma121 Date: Thu, 9 May 2024 22:35:04 +0530 Subject: [PATCH 1/2] DOC: add PR07,RT03,SA01 for pandas.IntervalIndex.get_loc --- pandas/core/indexes/interval.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pandas/core/indexes/interval.py b/pandas/core/indexes/interval.py index 058d59f401833..dcc5d3e4c3332 100644 --- a/pandas/core/indexes/interval.py +++ b/pandas/core/indexes/interval.py @@ -621,13 +621,27 @@ def get_loc(self, key) -> int | slice | np.ndarray: """ Get integer location, slice or boolean mask for requested label. + The `get_loc` method is used to retrieve the integer index, a slice for + slicing objects, or a boolean mask indicating the presence of the label + in the `IntervalIndex`. + Parameters ---------- key : label + The value or range to find in the IntervalIndex. Returns ------- int if unique index, slice if monotonic index, else mask + The position or positions found. This could be a single + number, a range, or an array of true/false values + indicating the position(s) of the label. + + See Also + -------- + IntervalIndex.get_indexer_non_unique : Compute indexer and + mask for new index given the current index. + Index.get_loc : Similar method in the base Index class. Examples -------- From f683931befa2c86b63f45f4aca6f31753f132df7 Mon Sep 17 00:00:00 2001 From: tuhinsharma121 Date: Thu, 9 May 2024 22:35:20 +0530 Subject: [PATCH 2/2] DOC: remove PR07,RT03,SA01 for pandas.IntervalIndex.get_loc --- ci/code_checks.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 87a2aac538572..de558171d9dd8 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -77,7 +77,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.DataFrame.plot PR02,SA01" \ -i "pandas.Grouper PR02" \ -i "pandas.Index PR07" \ - -i "pandas.IntervalIndex.get_loc PR07,RT03,SA01" \ -i "pandas.IntervalIndex.is_non_overlapping_monotonic SA01" \ -i "pandas.IntervalIndex.left GL08" \ -i "pandas.IntervalIndex.length GL08" \