File tree 1 file changed +5
-13
lines changed
1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -1067,22 +1067,14 @@ def reduction(
1067
1067
axis : AxisInt | None = None ,
1068
1068
skipna : bool = True ,
1069
1069
mask : npt .NDArray [np .bool_ ] | None = None ,
1070
- ) -> Dtype :
1071
- dtype = values .dtype
1070
+ ):
1071
+ if values .size == 0 :
1072
+ return _na_for_min_count (values , axis )
1073
+
1072
1074
values , mask = _get_values (
1073
1075
values , skipna , fill_value_typ = fill_value_typ , mask = mask
1074
1076
)
1075
-
1076
- if (axis is not None and values .shape [axis ] == 0 ) or values .size == 0 :
1077
- dtype_max = _get_dtype_max (dtype )
1078
- try :
1079
- result = getattr (values , meth )(axis , dtype = dtype_max )
1080
- result .fill (np .nan )
1081
- except (AttributeError , TypeError , ValueError ):
1082
- result = np .nan
1083
- else :
1084
- result = getattr (values , meth )(axis )
1085
-
1077
+ result = getattr (values , meth )(axis )
1086
1078
result = _maybe_null_out (result , axis , mask , values .shape )
1087
1079
return result
1088
1080
You can’t perform that action at this time.
0 commit comments