Skip to content

Commit eab9f9f

Browse files
committed
TYP: Fix typing issues, Label => IndexLabel
1 parent 1a254df commit eab9f9f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pandas/core/frame.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -6956,7 +6956,7 @@ def sort_index(
69566956

69576957
def value_counts(
69586958
self,
6959-
subset: Sequence[Hashable] | None = None,
6959+
subset: IndexLabel | None = None,
69606960
normalize: bool = False,
69616961
sort: bool = True,
69626962
ascending: bool = False,
@@ -7080,8 +7080,8 @@ def value_counts(
70807080
if normalize:
70817081
counts /= counts.sum()
70827082

7083-
# Force MultiIndex for single column
7084-
if is_list_like(subset) and len(subset) == 1:
7083+
# Force MultiIndex for a list_like subset with a single column
7084+
if is_list_like(subset) and len(subset) == 1: # type: ignore[arg-type]
70857085
counts.index = MultiIndex.from_arrays(
70867086
[counts.index], names=[counts.index.name]
70877087
)
@@ -8991,7 +8991,7 @@ def pivot_table(
89918991
sort=sort,
89928992
)
89938993

8994-
def stack(self, level: Level = -1, dropna: bool = True, sort: bool = True):
8994+
def stack(self, level: IndexLabel = -1, dropna: bool = True, sort: bool = True):
89958995
"""
89968996
Stack the prescribed level(s) from columns to index.
89978997
@@ -9296,7 +9296,7 @@ def explode(
92969296

92979297
return result.__finalize__(self, method="explode")
92989298

9299-
def unstack(self, level: Level = -1, fill_value=None, sort: bool = True):
9299+
def unstack(self, level: IndexLabel = -1, fill_value=None, sort: bool = True):
93009300
"""
93019301
Pivot a level of the (necessarily hierarchical) index labels.
93029302

0 commit comments

Comments
 (0)