@@ -6956,7 +6956,7 @@ def sort_index(
6956
6956
6957
6957
def value_counts (
6958
6958
self ,
6959
- subset : Sequence [ Hashable ] | None = None ,
6959
+ subset : IndexLabel | None = None ,
6960
6960
normalize : bool = False ,
6961
6961
sort : bool = True ,
6962
6962
ascending : bool = False ,
@@ -7081,7 +7081,7 @@ def value_counts(
7081
7081
counts /= counts .sum ()
7082
7082
7083
7083
# Force MultiIndex for single column
7084
- if is_list_like ( subset ) and len (subset ) == 1 :
7084
+ if len (counts . index . names ) == 1 :
7085
7085
counts .index = MultiIndex .from_arrays (
7086
7086
[counts .index ], names = [counts .index .name ]
7087
7087
)
@@ -7375,7 +7375,7 @@ def swaplevel(self, i: Axis = -2, j: Axis = -1, axis: Axis = 0) -> DataFrame:
7375
7375
result .columns = result .columns .swaplevel (i , j )
7376
7376
return result
7377
7377
7378
- def reorder_levels (self , order : Sequence [int | str ], axis : Axis = 0 ) -> DataFrame :
7378
+ def reorder_levels (self , order : Sequence [Hashable ], axis : Axis = 0 ) -> DataFrame :
7379
7379
"""
7380
7380
Rearrange index levels using input order. May not drop or duplicate levels.
7381
7381
@@ -8991,7 +8991,7 @@ def pivot_table(
8991
8991
sort = sort ,
8992
8992
)
8993
8993
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 ):
8995
8995
"""
8996
8996
Stack the prescribed level(s) from columns to index.
8997
8997
@@ -9296,7 +9296,7 @@ def explode(
9296
9296
9297
9297
return result .__finalize__ (self , method = "explode" )
9298
9298
9299
- def unstack (self , level : Level = - 1 , fill_value = None ):
9299
+ def unstack (self , level : IndexLabel = - 1 , fill_value = None ):
9300
9300
"""
9301
9301
Pivot a level of the (necessarily hierarchical) index labels.
9302
9302
0 commit comments