Skip to content

DOC: Enforce Numpy Docstring Validation for pandas.IntervalIndex.get_loc #58656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading