@@ -1046,11 +1046,9 @@ class _GroupByMixin(PandasObject):
1046
1046
1047
1047
_attributes : list [str ] # in practice the same as Resampler._attributes
1048
1048
1049
- def __init__ (self , obj , ** kwargs ):
1049
+ def __init__ (self , obj , parent = None , groupby = None , ** kwargs ):
1050
1050
# reached via ._gotitem and _get_resampler_for_grouping
1051
1051
1052
- parent = kwargs .pop ("parent" , None )
1053
- groupby = kwargs .pop ("groupby" , None )
1054
1052
if parent is None :
1055
1053
parent = obj
1056
1054
@@ -1416,15 +1414,13 @@ def get_resampler(obj, kind=None, **kwds):
1416
1414
1417
1415
1418
1416
def get_resampler_for_grouping (
1419
- groupby , rule , how = None , fill_method = None , limit = None , kind = None , ** kwargs
1417
+ groupby , rule , how = None , fill_method = None , limit = None , kind = None , on = None , ** kwargs
1420
1418
):
1421
1419
"""
1422
1420
Return our appropriate resampler when grouping as well.
1423
1421
"""
1424
1422
# .resample uses 'on' similar to how .groupby uses 'key'
1425
- kwargs ["key" ] = kwargs .pop ("on" , None )
1426
-
1427
- tg = TimeGrouper (freq = rule , ** kwargs )
1423
+ tg = TimeGrouper (freq = rule , key = on , ** kwargs )
1428
1424
resampler = tg ._get_resampler (groupby .obj , kind = kind )
1429
1425
return resampler ._get_resampler_for_grouping (groupby = groupby )
1430
1426
0 commit comments