From 0a786652b3824a239503ddd4a5392263d73c3376 Mon Sep 17 00:00:00 2001 From: pierregm Date: Thu, 6 Aug 2009 17:00:23 +0000 Subject: * fixed np.ma.average on integersw/ mask (bug #1188) --- numpy/ma/extras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'numpy/ma/extras.py') diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py index d4b78f986..9c6b7d66c 100644 --- a/numpy/ma/extras.py +++ b/numpy/ma/extras.py @@ -413,7 +413,7 @@ def average(a, axis=None, weights=None, returned=False): else: if weights is None: n = a.filled(0).sum(axis=None) - d = umath.add.reduce((-mask).ravel().astype(int)) + d = float(umath.add.reduce((~mask).ravel())) else: w = array(filled(weights, 0.0), float, mask=mask).ravel() n = add.reduce(a.ravel() * w) -- cgit v1.2.1