Skip to content

Commit ebeb865

Browse files
committed
TYP: Fix typing issues, mainly Something => IndexLabel
1 parent a1f050a commit ebeb865

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

pandas/core/frame.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ def _repr_html_(self) -> str | None:
11401140
def to_string(
11411141
self,
11421142
buf: None = ...,
1143-
columns: Axes | None = ...,
1143+
columns: IndexLabel | None = ...,
11441144
col_space: int | list[int] | dict[Hashable, int] | None = ...,
11451145
header: bool | list[str] = ...,
11461146
index: bool = ...,
@@ -1165,7 +1165,7 @@ def to_string(
11651165
def to_string(
11661166
self,
11671167
buf: FilePath | WriteBuffer[str],
1168-
columns: Axes | None = ...,
1168+
columns: IndexLabel | None = ...,
11691169
col_space: int | list[int] | dict[Hashable, int] | None = ...,
11701170
header: bool | list[str] = ...,
11711171
index: bool = ...,
@@ -1200,7 +1200,7 @@ def to_string(
12001200
def to_string(
12011201
self,
12021202
buf: FilePath | WriteBuffer[str] | None = None,
1203-
columns: Axes | None = None,
1203+
columns: IndexLabel | None = None,
12041204
col_space: int | list[int] | dict[Hashable, int] | None = None,
12051205
header: bool | list[str] = True,
12061206
index: bool = True,
@@ -2997,7 +2997,7 @@ def to_orc(
29972997
def to_html(
29982998
self,
29992999
buf: FilePath | WriteBuffer[str],
3000-
columns: Axes | None = ...,
3000+
columns: IndexLabel | None = ...,
30013001
col_space: ColspaceArgType | None = ...,
30023002
header: bool = ...,
30033003
index: bool = ...,
@@ -3026,7 +3026,7 @@ def to_html(
30263026
def to_html(
30273027
self,
30283028
buf: None = ...,
3029-
columns: Axes | None = ...,
3029+
columns: IndexLabel | None = ...,
30303030
col_space: ColspaceArgType | None = ...,
30313031
header: bool = ...,
30323032
index: bool = ...,
@@ -3062,7 +3062,7 @@ def to_html(
30623062
def to_html(
30633063
self,
30643064
buf: FilePath | WriteBuffer[str] | None = None,
3065-
columns: Axes | None = None,
3065+
columns: IndexLabel | None = None,
30663066
col_space: ColspaceArgType | None = None,
30673067
header: bool = True,
30683068
index: bool = True,
@@ -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,
@@ -7081,7 +7081,7 @@ def value_counts(
70817081
counts /= counts.sum()
70827082

70837083
# Force MultiIndex for single column
7084-
if is_list_like(subset) and len(subset) == 1:
7084+
if len(counts.index.names) == 1:
70857085
counts.index = MultiIndex.from_arrays(
70867086
[counts.index], names=[counts.index.name]
70877087
)
@@ -7375,7 +7375,7 @@ def swaplevel(self, i: Axis = -2, j: Axis = -1, axis: Axis = 0) -> DataFrame:
73757375
result.columns = result.columns.swaplevel(i, j)
73767376
return result
73777377

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:
73797379
"""
73807380
Rearrange index levels using input order. May not drop or duplicate levels.
73817381
@@ -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):
9299+
def unstack(self, level: IndexLabel = -1, fill_value=None):
93009300
"""
93019301
Pivot a level of the (necessarily hierarchical) index labels.
93029302

0 commit comments

Comments
 (0)