Skip to content

Commit 69b76de

Browse files
jbrockmendelMateusz Górski
authored and
Mateusz Górski
committed
Check instead of try/except (pandas-dev#29587)
1 parent df6cf44 commit 69b76de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,9 @@ def _aggregate_multiple_funcs(self, arg, _level, _axis):
602602
if not len(results):
603603
raise ValueError("no results")
604604

605-
try:
605+
if all(np.ndim(x) > 0 for x in results):
606606
return concat(results, keys=keys, axis=1, sort=False)
607-
except TypeError:
607+
else:
608608

609609
# we are concatting non-NDFrame objects,
610610
# e.g. a list of scalars

0 commit comments

Comments
 (0)