Index.
slice_locs
Compute slice locations for input labels.
If None, defaults to the beginning.
If None, defaults to the end.
If None, defaults to 1.
See also
Index.get_loc
Get location for a single label.
Notes
This method only works if the index is monotonic or unique.
Examples
>>> idx = pd.Index(list('abcd')) >>> idx.slice_locs(start='b', end='c') (1, 3)