xarray.CFTimeIndex.slice_locs
xarray.CFTimeIndex.slice_locs#
- CFTimeIndex.slice_locs(start=None, end=None, step=None, kind=_NoDefault.no_default)[source]#
Compute slice locations for input labels.
- Parameters
- Returns
start, end (
int
)
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)