Skip to content

Commit a4618bf

Browse files
author
aschade
committed
BUG: Raise on drop on dup index
1 parent f43dbf8 commit a4618bf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/core/generic.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2909,6 +2909,9 @@ def _drop_axis(self, labels, axis, level=None, errors='raise'):
29092909
else:
29102910
indexer = ~axis.isin(labels)
29112911

2912+
if all(indexer) and errors == 'raise':
2913+
raise ValueError('{} not found in axis'.format(labels))
2914+
29122915
slicer = [slice(None)] * self.ndim
29132916
slicer[self._get_axis_number(axis_name)] = indexer
29142917

0 commit comments

Comments
 (0)