diff --git a/pandas/core/groupby/ops.py b/pandas/core/groupby/ops.py index 1a3f0da3cf92b..40517eefe4d5d 100644 --- a/pandas/core/groupby/ops.py +++ b/pandas/core/groupby/ops.py @@ -212,9 +212,12 @@ def apply(self, f, data, axis=0): # This Exception is also raised if `f` triggers an exception # but it is preferable to raise the exception in Python. pass - except TypeError: - # occurs if we have any EAs - pass + except TypeError as err: + if "Cannot convert" in str(err): + # via apply_frame_axis0 if we pass a non-ndarray + pass + else: + raise for key, (i, group) in zip(group_keys, splitter): object.__setattr__(group, "name", key)