We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eca19a2 commit 390f3efCopy full SHA for 390f3ef
pandas/core/indexes/base.py
@@ -2085,7 +2085,6 @@ def _validate_index_level(self, level) -> None:
2085
2086
"""
2087
if type(level) is int:
2088
-
2089
if isinstance(self.name, int) and level == self.name:
2090
return
2091
@@ -2100,9 +2099,7 @@ def _validate_index_level(self, level) -> None:
2100
2099
)
2101
2102
elif (
2103
- isinstance(level, str)
2104
- and isinstance(self.name, str)
2105
- and level != self.name
+ isinstance(level, str) and isinstance(self.name, str) and level != self.name
2106
):
2107
raise KeyError(
2108
f"Requested level ({level}) does not match index name ({self.name})"
0 commit comments