@@ -462,7 +462,7 @@ def _groupby_and_aggregate(self, how, *args, **kwargs):
462462 # a DataFrame column, but aggregate_item_by_item operates column-wise
463463 # on Series, raising AttributeError or KeyError
464464 # (depending on whether the column lookup uses getattr/__getitem__)
465- result = _apply ( grouped , how , * args , ** kwargs )
465+ result = grouped . apply ( how , * args , ** kwargs )
466466
467467 except ValueError as err :
468468 if "Must produce aggregated value" in str (err ):
@@ -474,7 +474,7 @@ def _groupby_and_aggregate(self, how, *args, **kwargs):
474474
475475 # we have a non-reducing function
476476 # try to evaluate
477- result = _apply ( grouped , how , * args , ** kwargs )
477+ result = grouped . apply ( how , * args , ** kwargs )
478478
479479 return self ._wrap_result (result )
480480
@@ -1576,7 +1576,7 @@ def func(x):
15761576
15771577 return x .apply (f , * args , ** kwargs )
15781578
1579- result = _apply ( self ._groupby , func )
1579+ result = self ._groupby . apply ( func )
15801580 return self ._wrap_result (result )
15811581
15821582 _upsample = _apply
@@ -2719,8 +2719,3 @@ def _asfreq_compat(index: FreqIndexT, freq) -> FreqIndexT:
27192719 else : # pragma: no cover
27202720 raise TypeError (type (index ))
27212721 return new_index
2722-
2723-
2724- def _apply (grouped : GroupBy , how : Callable , * args , ** kwargs ) -> DataFrame :
2725- result = grouped .apply (how , * args , ** kwargs )
2726- return result
0 commit comments