summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2009-08-06 17:00:23 +0000
committerpierregm <pierregm@localhost>2009-08-06 17:00:23 +0000
commit0a786652b3824a239503ddd4a5392263d73c3376 (patch)
treeb0b3cb3326c8994925f9e3fd94d0bf22b7b21654 /numpy/ma/extras.py
parentd0bba527fa3ade5674c670b6df1d7ad0346603c1 (diff)
downloadnumpy-0a786652b3824a239503ddd4a5392263d73c3376.tar.gz
* fixed np.ma.average on integersw/ mask (bug #1188)
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r--numpy/ma/extras.py2
1 files changed, 1 insertions, 1 deletions
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)