File tree 3 files changed +8
-7
lines changed
3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 159
159
160
160
# types of `func` kwarg for DataFrame.aggregate and Series.aggregate
161
161
AggFuncTypeBase = Union [Callable , str ]
162
- AggFuncTypeDict = Dict [Hashable , Union [AggFuncTypeBase , List [AggFuncTypeBase ]]]
162
+ SeriesAggFuncType = Union [AggFuncTypeBase , List [AggFuncTypeBase ]]
163
+ AggFuncTypeDict = Dict [Hashable , SeriesAggFuncType ]
163
164
AggFuncType = Union [
164
- AggFuncTypeBase ,
165
- List [AggFuncTypeBase ],
165
+ SeriesAggFuncType ,
166
166
AggFuncTypeDict ,
167
167
]
168
168
AggObjType = Union [
Original file line number Diff line number Diff line change 32
32
AggObjType ,
33
33
Axis ,
34
34
NDFrameT ,
35
+ SeriesAggFuncType ,
35
36
npt ,
36
37
)
37
38
from pandas .util ._decorators import cache_readonly
@@ -1049,7 +1050,7 @@ class SeriesApply(NDFrameApply):
1049
1050
def __init__ (
1050
1051
self ,
1051
1052
obj : Series ,
1052
- func : AggFuncTypeBase | list [ AggFuncTypeBase ] ,
1053
+ func : SeriesAggFuncType ,
1053
1054
convert_dtype : bool ,
1054
1055
args ,
1055
1056
kwargs ,
Original file line number Diff line number Diff line change 32
32
)
33
33
from pandas ._libs .lib import no_default
34
34
from pandas ._typing import (
35
- AggFuncTypeBase ,
36
35
ArrayLike ,
37
36
Axis ,
38
37
Dtype ,
43
42
Level ,
44
43
NaPosition ,
45
44
Renamer ,
45
+ SeriesAggFuncType ,
46
46
SingleManager ,
47
47
SortKind ,
48
48
StorageOptions ,
@@ -4440,7 +4440,7 @@ def any(
4440
4440
)
4441
4441
def transform (
4442
4442
self ,
4443
- func : AggFuncTypeBase | list [ AggFuncTypeBase ] ,
4443
+ func : SeriesAggFuncType ,
4444
4444
axis : Axis = 0 ,
4445
4445
* args ,
4446
4446
** kwargs ,
@@ -4454,7 +4454,7 @@ def transform(
4454
4454
4455
4455
def apply (
4456
4456
self ,
4457
- func : AggFuncTypeBase | list [ AggFuncTypeBase ] ,
4457
+ func : SeriesAggFuncType ,
4458
4458
convert_dtype : bool = True ,
4459
4459
args : tuple [Any , ...] = (),
4460
4460
** kwargs ,
You can’t perform that action at this time.
0 commit comments