Skip to content

Commit

Permalink
DOC: Enforce Numpy Docstring Validation for pandas.Index.get_loc (#58509
Browse files Browse the repository at this point in the history
)

* DOC: add PR07,RT03,SA01 in pandas.Index.get_loc

* DOC: remove PR07,RT03,SA01 in pandas.Index.get_loc
  • Loading branch information
tuhinsharma121 authored May 1, 2024
1 parent 9250bf7 commit 9110f7c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.DataFrame.var PR01,RT03,SA01" \
-i "pandas.Grouper PR02" \
-i "pandas.Index PR07" \
-i "pandas.Index.get_loc PR07,RT03,SA01" \
-i "pandas.Index.join PR07,RT03,SA01" \
-i "pandas.Index.names GL08" \
-i "pandas.Index.ravel PR01,RT03" \
Expand Down
12 changes: 12 additions & 0 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3490,10 +3490,22 @@ def get_loc(self, key):
Parameters
----------
key : label
The key to check its location if it is present in the index.
Returns
-------
int if unique index, slice if monotonic index, else mask
Integer location, slice or boolean mask.
See Also
--------
Index.get_slice_bound : Calculate slice bound that corresponds to
given label.
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.
Index.get_indexer_for : Returns an indexer even when non-unique.
Examples
--------
Expand Down

0 comments on commit 9110f7c

Please sign in to comment.