Skip to content

Commit c8776b8

Browse files
Switch boolean statements.
1 parent dccbb94 commit c8776b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ def _validate_key(self, key, axis: int):
965965
# slice of labels (where start-end in labels)
966966
# slice of integers (only if in the labels)
967967
# boolean not in slice and with boolean index
968-
if not is_bool_dtype(self.obj.index) and isinstance(key, bool):
968+
if isinstance(key, bool) and not is_bool_dtype(self.obj.index):
969969
raise TypeError("Boolean label can not be used without a boolean index")
970970

971971
if isinstance(key, slice) and (

0 commit comments

Comments
 (0)