Skip to content

Commit

Permalink
Merge pull request astropy#17544 from mhvk/masked-remove-duplicated-call
Browse files Browse the repository at this point in the history
MAINT: remove duplicated calculation of number of points
  • Loading branch information
neutrinoceros authored Dec 16, 2024
2 parents ca602e3 + 312c519 commit fda05b8
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion astropy/utils/masked/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fda05b8

Please sign in to comment.