Skip to content

Commit 7bdadf1

Browse files
author
tp
committed
index may be unique + added notw on keyError
1 parent 6cab315 commit 7bdadf1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pandas/core/indexes/base.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -3430,8 +3430,8 @@ def _get_string_slice(self, key, use_lhs=True, use_rhs=True):
34303430

34313431
def slice_indexer(self, start=None, end=None, step=None, kind=None):
34323432
"""
3433-
For an ordered index, compute the slice indexer for input labels and
3434-
step
3433+
For an ordered or unique index, compute the slice indexer for input
3434+
labels and step.
34353435
34363436
Parameters
34373437
----------
@@ -3446,6 +3446,11 @@ def slice_indexer(self, start=None, end=None, step=None, kind=None):
34463446
-------
34473447
indexer : slice
34483448
3449+
Raises
3450+
------
3451+
KeyError : If key does not exist, or key is not unique and index is
3452+
not ordered.
3453+
34493454
Notes
34503455
-----
34513456
This function assumes that the data is sorted, so use at your own peril

0 commit comments

Comments
 (0)