Skip to content

Commit 1a37e0e

Browse files
committed
fix level and mypy warning
1 parent f151dba commit 1a37e0e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/generic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
ClassVar,
1717
Literal,
1818
NoReturn,
19+
Sequence,
1920
cast,
2021
final,
2122
overload,
@@ -4126,9 +4127,10 @@ class animal locomotion
41264127
index = self.index
41274128

41284129
if isinstance(index, MultiIndex):
4130+
level = range(len(key)) if isinstance(key, Sequence) else 0
41294131
loc, new_index = index.get_loc_level(
41304132
key,
4131-
level=range(len(key)),
4133+
level=level,
41324134
drop_level=drop_level
41334135
)
41344136
if not drop_level:

0 commit comments

Comments
 (0)