Skip to content

Commit 1df457f

Browse files
DOC: Enforce Numpy Docstring Validation for pandas.IntervalIndex.get_loc (#58656)
* DOC: add PR07,RT03,SA01 for pandas.IntervalIndex.get_loc * DOC: remove PR07,RT03,SA01 for pandas.IntervalIndex.get_loc
1 parent 5786f14 commit 1df457f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7777
-i "pandas.DataFrame.plot PR02,SA01" \
7878
-i "pandas.Grouper PR02" \
7979
-i "pandas.Index PR07" \
80-
-i "pandas.IntervalIndex.get_loc PR07,RT03,SA01" \
8180
-i "pandas.IntervalIndex.is_non_overlapping_monotonic SA01" \
8281
-i "pandas.IntervalIndex.left GL08" \
8382
-i "pandas.IntervalIndex.length GL08" \

pandas/core/indexes/interval.py

+14
Original file line numberDiff line numberDiff line change
@@ -621,13 +621,27 @@ def get_loc(self, key) -> int | slice | np.ndarray:
621621
"""
622622
Get integer location, slice or boolean mask for requested label.
623623
624+
The `get_loc` method is used to retrieve the integer index, a slice for
625+
slicing objects, or a boolean mask indicating the presence of the label
626+
in the `IntervalIndex`.
627+
624628
Parameters
625629
----------
626630
key : label
631+
The value or range to find in the IntervalIndex.
627632
628633
Returns
629634
-------
630635
int if unique index, slice if monotonic index, else mask
636+
The position or positions found. This could be a single
637+
number, a range, or an array of true/false values
638+
indicating the position(s) of the label.
639+
640+
See Also
641+
--------
642+
IntervalIndex.get_indexer_non_unique : Compute indexer and
643+
mask for new index given the current index.
644+
Index.get_loc : Similar method in the base Index class.
631645
632646
Examples
633647
--------

0 commit comments

Comments
 (0)