Skip to content

Commit 288bd70

Browse files
committed
PERF: reverted change from commit 7d257c6 to solve issue #37081
1 parent c45da41 commit 288bd70

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
@@ -8746,11 +8746,6 @@ def _reduce(
87468746
cols = self.columns[~dtype_is_dt]
87478747
self = self[cols]
87488748

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

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

0 commit comments

Comments
 (0)