@@ -51,19 +51,24 @@ _NonIterableHashable: TypeAlias = (
51
51
| pd .Timedelta
52
52
)
53
53
54
- _PivotTableIndexTypes : TypeAlias = Label | list [HashableT1 ] | Series | Grouper | None
55
- _PivotTableColumnsTypes : TypeAlias = Label | list [HashableT2 ] | Series | Grouper | None
54
+ _PivotTableIndexTypes : TypeAlias = (
55
+ Label | Sequence [HashableT1 ] | Series | Grouper | None
56
+ )
57
+ _PivotTableColumnsTypes : TypeAlias = (
58
+ Label | Sequence [HashableT2 ] | Series | Grouper | None
59
+ )
60
+ _PivotTableValuesTypes : TypeAlias = Label | Sequence [HashableT3 ] | None
56
61
57
62
_ExtendedAnyArrayLike : TypeAlias = AnyArrayLike | ArrayLike
58
63
59
64
@overload
60
65
def pivot_table (
61
66
data : DataFrame ,
62
- values : Label | list [ HashableT3 ] | None = ...,
67
+ values : _PivotTableValuesTypes = ...,
63
68
index : _PivotTableIndexTypes = ...,
64
69
columns : _PivotTableColumnsTypes = ...,
65
70
aggfunc : (
66
- _PivotAggFunc | list [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
71
+ _PivotAggFunc | Sequence [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
67
72
) = ...,
68
73
fill_value : Scalar | None = ...,
69
74
margins : bool = ...,
@@ -77,12 +82,12 @@ def pivot_table(
77
82
@overload
78
83
def pivot_table (
79
84
data : DataFrame ,
80
- values : Label | list [ HashableT3 ] | None = ...,
85
+ values : _PivotTableValuesTypes = ...,
81
86
* ,
82
87
index : Grouper ,
83
88
columns : _PivotTableColumnsTypes | Index | npt .NDArray = ...,
84
89
aggfunc : (
85
- _PivotAggFunc | list [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
90
+ _PivotAggFunc | Sequence [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
86
91
) = ...,
87
92
fill_value : Scalar | None = ...,
88
93
margins : bool = ...,
@@ -94,12 +99,12 @@ def pivot_table(
94
99
@overload
95
100
def pivot_table (
96
101
data : DataFrame ,
97
- values : Label | list [ HashableT3 ] | None = ...,
102
+ values : _PivotTableValuesTypes = ...,
98
103
index : _PivotTableIndexTypes | Index | npt .NDArray = ...,
99
104
* ,
100
105
columns : Grouper ,
101
106
aggfunc : (
102
- _PivotAggFunc | list [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
107
+ _PivotAggFunc | Sequence [_PivotAggFunc ] | Mapping [Hashable , _PivotAggFunc ]
103
108
) = ...,
104
109
fill_value : Scalar | None = ...,
105
110
margins : bool = ...,
@@ -111,9 +116,9 @@ def pivot_table(
111
116
def pivot (
112
117
data : DataFrame ,
113
118
* ,
114
- index : _NonIterableHashable | list [HashableT1 ] = ...,
115
- columns : _NonIterableHashable | list [HashableT2 ] = ...,
116
- values : _NonIterableHashable | list [HashableT3 ] = ...,
119
+ index : _NonIterableHashable | Sequence [HashableT1 ] = ...,
120
+ columns : _NonIterableHashable | Sequence [HashableT2 ] = ...,
121
+ values : _NonIterableHashable | Sequence [HashableT3 ] = ...,
117
122
) -> DataFrame : ...
118
123
@overload
119
124
def crosstab (
0 commit comments