Skip to content

Commit 0573c3a

Browse files
authored
PERF: reverted change from commit 7d257c6 to solve issue #37081 (#37426)
1 parent 4f56b2d commit 0573c3a

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

pandas/core/frame.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -8747,11 +8747,6 @@ def _reduce(
87478747
cols = self.columns[~dtype_is_dt]
87488748
self = self[cols]
87498749

8750-
any_object = np.array(
8751-
[is_object_dtype(dtype) for dtype in own_dtypes],
8752-
dtype=bool,
8753-
).any()
8754-
87558750
# TODO: Make other agg func handle axis=None properly GH#21597
87568751
axis = self._get_axis_number(axis)
87578752
labels = self._get_agg_axis(axis)
@@ -8778,12 +8773,7 @@ def _get_data() -> DataFrame:
87788773
data = self._get_bool_data()
87798774
return data
87808775

8781-
if numeric_only is not None or (
8782-
numeric_only is None
8783-
and axis == 0
8784-
and not any_object
8785-
and not self._mgr.any_extension_types
8786-
):
8776+
if numeric_only is not None:
87878777
# For numeric_only non-None and axis non-None, we know
87888778
# which blocks to use and no try/except is needed.
87898779
# For numeric_only=None only the case with axis==0 and no object

0 commit comments

Comments
 (0)