Skip to content

Commit

Permalink
DOC: Enforce Numpy Docstring Validation for pandas.Index.sliece_index…
Browse files Browse the repository at this point in the history
…er (#58490)

* DOC: add PR07,RT03 in pandas.Index.slice_indexer

* DOC: add SA01 in pandas.Index.slice_indexer

* DOC: remove pandas.Index.slice_indexer
  • Loading branch information
tuhinsharma121 authored Apr 30, 2024
1 parent f290985 commit 2e7fa91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Index.names GL08" \
-i "pandas.Index.putmask PR01,RT03" \
-i "pandas.Index.ravel PR01,RT03" \
-i "pandas.Index.slice_indexer PR07,RT03,SA01" \
-i "pandas.Index.str PR01,SA01" \
-i "pandas.Index.view GL08" \
-i "pandas.Int16Dtype SA01" \
Expand Down
9 changes: 8 additions & 1 deletion pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6342,19 +6342,26 @@ def slice_indexer(
end : label, default None
If None, defaults to the end.
step : int, default None
If None, defaults to 1.
Returns
-------
slice
A slice object.
Raises
------
KeyError : If key does not exist, or key is not unique and index is
not ordered.
See Also
--------
Index.slice_locs : Computes slice locations for input labels.
Index.get_slice_bound : Retrieves slice bound that corresponds to given label.
Notes
-----
This function assumes that the data is sorted, so use at your own peril
This function assumes that the data is sorted, so use at your own peril.
Examples
--------
Expand Down

0 comments on commit 2e7fa91

Please sign in to comment.