Skip to content

Commit

Permalink
DOC: Enforce Numpy Docstring Validation for pandas.IntervalIndex.get_…
Browse files Browse the repository at this point in the history
…loc (#58656)

* DOC: add PR07,RT03,SA01 for pandas.IntervalIndex.get_loc

* DOC: remove PR07,RT03,SA01 for pandas.IntervalIndex.get_loc
  • Loading branch information
tuhinsharma121 committed May 9, 2024
1 parent 5786f14 commit 1df457f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Expand Up @@ -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" \
Expand Down
14 changes: 14 additions & 0 deletions pandas/core/indexes/interval.py
Expand Up @@ -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
--------
Expand Down

0 comments on commit 1df457f

Please sign in to comment.