Skip to content

Commit 37aba9e

Browse files
committed
Separate lines in calculation
1 parent bae9b75 commit 37aba9e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pandas/core/array_algos/masked_reductions.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ def max(values: np.ndarray, mask: np.ndarray, skipna: bool = True):
102102
return _minmax(np.max, values=values, mask=mask, skipna=skipna)
103103

104104

105-
def mean(values: np.ndarray, mask: np.ndarray, skipna: bool = True, min_count: int = 0):
106-
return _sumprod(
107-
np.sum, values=values, mask=mask, skipna=skipna, min_count=min_count
108-
) / np.count_nonzero(~mask)
105+
def mean(values: np.ndarray, mask: np.ndarray, skipna: bool = True):
106+
107+
_sum = _sumprod(np.sum, values=values, mask=mask, skipna=skipna)
108+
count = np.count_nonzero(~mask)
109+
mean_value = _sum / count
110+
return mean_value

0 commit comments

Comments
 (0)