Skip to content

Commit 703085e

Browse files
committed
BUG: Refactor error message formatting in Index class for clarity
1 parent 7f541de commit 703085e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/indexes/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,7 @@ def _validate_index_level(self, level) -> None:
21122112
return
21132113
if level < 0 and level != -1:
21142114
raise IndexError(
2115-
"Too many levels: Index has only 1 level, not {}".format(level + 1)
2115+
f"Too many levels: Index has only 1 level, not {level + 1}"
21162116
)
21172117
return
21182118

0 commit comments

Comments
 (0)