From 312c519494e143ad029dc7d064c9a464bc73aabf Mon Sep 17 00:00:00 2001 From: Marten Henric van Kerkwijk Date: Sat, 14 Dec 2024 14:02:49 -0500 Subject: [PATCH] MAINT: remove duplicated calculation of number of points --- astropy/utils/masked/core.py | 1 - 1 file changed, 1 deletion(-) diff --git a/astropy/utils/masked/core.py b/astropy/utils/masked/core.py index 223bdf69f15..92442b059c1 100644 --- a/astropy/utils/masked/core.py +++ b/astropy/utils/masked/core.py @@ -1302,7 +1302,6 @@ def mean(self, axis=None, dtype=None, out=None, keepdims=False, *, where=True): n = np.add.reduce(where, axis=axis, keepdims=keepdims) # catch the case when an axis is fully masked to prevent div by zero: - n = np.add.reduce(where, axis=axis, keepdims=keepdims) neq0 = n == 0 n += neq0 result /= n