Skip to content

Commit cbf735a

Browse files
committed
ENH: delete item_by_item branch in groupby
1 parent dc8d4c0 commit cbf735a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pandas/core/groupby.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -917,11 +917,9 @@ def aggregate(self, arg, *args, **kwargs):
917917
result = DataFrame(result)
918918
else:
919919
if len(self.groupings) > 1:
920-
try:
921-
return self._python_agg_general(arg, *args, **kwargs)
922-
except Exception:
923-
return self._aggregate_item_by_item(arg, *args, **kwargs)
924-
result = self._aggregate_generic(arg, *args, **kwargs)
920+
return self._python_agg_general(arg, *args, **kwargs)
921+
else:
922+
result = self._aggregate_generic(arg, *args, **kwargs)
925923

926924
if not self.as_index:
927925
if isinstance(result.index, MultiIndex):
@@ -971,7 +969,6 @@ def _aggregate_item_by_item(self, func, *args, **kwargs):
971969
# only for axis==0
972970

973971
obj = self._obj_with_exclusions
974-
975972
result = {}
976973
cannot_agg = []
977974
for item in obj:

0 commit comments

Comments
 (0)