Skip to content

Commit

Permalink
[PERF] Fixed issue pandas-dev#37081
Browse files Browse the repository at this point in the history
  • Loading branch information
ukarroum committed Oct 14, 2020
1 parent c0c3516 commit 6357ac2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -8670,7 +8670,10 @@ def _reduce(
cols = self.columns[~dtype_is_dt]
self = self[cols]

any_object = self.dtypes.apply(is_object_dtype).any()
any_object = np.array(
[is_object_dtype(values.dtype) for values in self._iter_column_arrays()],
dtype=bool,
).any()
# TODO: Make other agg func handle axis=None properly GH#21597
axis = self._get_axis_number(axis)
labels = self._get_agg_axis(axis)
Expand Down

0 comments on commit 6357ac2

Please sign in to comment.