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 d881247 commit 3e63865Copy full SHA for 3e63865
pandas/core/indexes/base.py
@@ -2088,7 +2088,7 @@ def _validate_index_level(self, level) -> None:
2088
# Also reject all NA-like values (np.nan, pd.NA, pd.NaT, etc.)
2089
if isna(level):
2090
raise KeyError(
2091
- "Requested level is NA/NaN/NaT, which is not a valid level name"
+ f"Requested level ({level}) does not match index name ({self.name})"
2092
)
2093
2094
# Reject booleans unless the index name is actually a boolean and matches
0 commit comments