@@ -1140,7 +1140,7 @@ def _repr_html_(self) -> str | None:
1140
1140
def to_string (
1141
1141
self ,
1142
1142
buf : None = ...,
1143
- columns : Axes | None = ...,
1143
+ columns : IndexLabel | None = ...,
1144
1144
col_space : int | list [int ] | dict [Hashable , int ] | None = ...,
1145
1145
header : bool | list [str ] = ...,
1146
1146
index : bool = ...,
@@ -1165,7 +1165,7 @@ def to_string(
1165
1165
def to_string (
1166
1166
self ,
1167
1167
buf : FilePath | WriteBuffer [str ],
1168
- columns : Axes | None = ...,
1168
+ columns : IndexLabel | None = ...,
1169
1169
col_space : int | list [int ] | dict [Hashable , int ] | None = ...,
1170
1170
header : bool | list [str ] = ...,
1171
1171
index : bool = ...,
@@ -1200,7 +1200,7 @@ def to_string(
1200
1200
def to_string (
1201
1201
self ,
1202
1202
buf : FilePath | WriteBuffer [str ] | None = None ,
1203
- columns : Axes | None = None ,
1203
+ columns : IndexLabel | None = None ,
1204
1204
col_space : int | list [int ] | dict [Hashable , int ] | None = None ,
1205
1205
header : bool | list [str ] = True ,
1206
1206
index : bool = True ,
@@ -2997,7 +2997,7 @@ def to_orc(
2997
2997
def to_html (
2998
2998
self ,
2999
2999
buf : FilePath | WriteBuffer [str ],
3000
- columns : Axes | None = ...,
3000
+ columns : IndexLabel | None = ...,
3001
3001
col_space : ColspaceArgType | None = ...,
3002
3002
header : bool = ...,
3003
3003
index : bool = ...,
@@ -3026,7 +3026,7 @@ def to_html(
3026
3026
def to_html (
3027
3027
self ,
3028
3028
buf : None = ...,
3029
- columns : Axes | None = ...,
3029
+ columns : IndexLabel | None = ...,
3030
3030
col_space : ColspaceArgType | None = ...,
3031
3031
header : bool = ...,
3032
3032
index : bool = ...,
@@ -3062,7 +3062,7 @@ def to_html(
3062
3062
def to_html (
3063
3063
self ,
3064
3064
buf : FilePath | WriteBuffer [str ] | None = None ,
3065
- columns : Axes | None = None ,
3065
+ columns : IndexLabel | None = None ,
3066
3066
col_space : ColspaceArgType | None = None ,
3067
3067
header : bool = True ,
3068
3068
index : bool = True ,
@@ -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