@@ -462,7 +462,7 @@ def _groupby_and_aggregate(self, how, *args, **kwargs):
462
462
# a DataFrame column, but aggregate_item_by_item operates column-wise
463
463
# on Series, raising AttributeError or KeyError
464
464
# (depending on whether the column lookup uses getattr/__getitem__)
465
- result = _apply ( grouped , how , * args , ** kwargs )
465
+ result = grouped . apply ( how , * args , ** kwargs )
466
466
467
467
except ValueError as err :
468
468
if "Must produce aggregated value" in str (err ):
@@ -474,7 +474,7 @@ def _groupby_and_aggregate(self, how, *args, **kwargs):
474
474
475
475
# we have a non-reducing function
476
476
# try to evaluate
477
- result = _apply ( grouped , how , * args , ** kwargs )
477
+ result = grouped . apply ( how , * args , ** kwargs )
478
478
479
479
return self ._wrap_result (result )
480
480
@@ -1576,7 +1576,7 @@ def func(x):
1576
1576
1577
1577
return x .apply (f , * args , ** kwargs )
1578
1578
1579
- result = _apply ( self ._groupby , func )
1579
+ result = self ._groupby . apply ( func )
1580
1580
return self ._wrap_result (result )
1581
1581
1582
1582
_upsample = _apply
@@ -2719,8 +2719,3 @@ def _asfreq_compat(index: FreqIndexT, freq) -> FreqIndexT:
2719
2719
else : # pragma: no cover
2720
2720
raise TypeError (type (index ))
2721
2721
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