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