File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -8652,11 +8652,10 @@ def _reduce(
8652
8652
assert filter_type is None or filter_type == "bool" , filter_type
8653
8653
out_dtype = "bool" if filter_type == "bool" else None
8654
8654
8655
+ own_dtypes = [arr .dtype for arr in self ._iter_column_arrays ()]
8656
+
8655
8657
dtype_is_dt = np .array (
8656
- [
8657
- is_datetime64_any_dtype (values .dtype )
8658
- for values in self ._iter_column_arrays ()
8659
- ],
8658
+ [is_datetime64_any_dtype (dtype ) for dtype in own_dtypes ],
8660
8659
dtype = bool ,
8661
8660
)
8662
8661
if numeric_only is None and name in ["mean" , "median" ] and dtype_is_dt .any ():
@@ -8671,9 +8670,10 @@ def _reduce(
8671
8670
self = self [cols ]
8672
8671
8673
8672
any_object = np .array (
8674
- [is_object_dtype (values . dtype ) for values in self . _iter_column_arrays () ],
8673
+ [is_object_dtype (dtype ) for dtype in own_dtypes ],
8675
8674
dtype = bool ,
8676
8675
).any ()
8676
+
8677
8677
# TODO: Make other agg func handle axis=None properly GH#21597
8678
8678
axis = self ._get_axis_number (axis )
8679
8679
labels = self ._get_agg_axis (axis )
You can’t perform that action at this time.
0 commit comments