Skip to content

Commit 87b1934

Browse files
KeiOshimapmhatre1
authored andcommitted
DOC: Add return value for Index.slice_locs when label not found pandas-dev#32680 (pandas-dev#58135)
* add return value if non-existent label is provided in pandas.Index.slice_locs * fix Line too long error * remove trailing whitespace * fix double line break * writing as example instead of note
1 parent 1ab7ac8 commit 87b1934

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/core/indexes/base.py

+4
Original file line numberDiff line numberDiff line change
@@ -6434,6 +6434,10 @@ def slice_locs(self, start=None, end=None, step=None) -> tuple[int, int]:
64346434
>>> idx = pd.Index(list("abcd"))
64356435
>>> idx.slice_locs(start="b", end="c")
64366436
(1, 3)
6437+
6438+
>>> idx = pd.Index(list("bcde"))
6439+
>>> idx.slice_locs(start="a", end="c")
6440+
(0, 2)
64376441
"""
64386442
inc = step is None or step >= 0
64396443

0 commit comments

Comments
 (0)