summaryrefslogtreecommitdiff
path: root/numpy/ma/core.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-09-27 01:37:34 -0700
committerEric Wieser <wieser.eric@gmail.com>2017-09-27 01:39:04 -0700
commitf01d1a6a5c381a4406d92db2993bf01b8e849b8c (patch)
treebb09941ffbcae53d40009e182dd7846865606dd1 /numpy/ma/core.py
parent7666d14a5b5c2d94ddb064db83e85d8b8656c7d5 (diff)
downloadnumpy-f01d1a6a5c381a4406d92db2993bf01b8e849b8c.tar.gz
BUG: np.ma.trace gives the wrong result on ND arrays
Fixes #5560
Diffstat (limited to 'numpy/ma/core.py')
-rw-r--r--numpy/ma/core.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 1f70d78e0..67a813bf7 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -4819,7 +4819,7 @@ class MaskedArray(ndarray):
return result.astype(dtype)
else:
D = self.diagonal(offset=offset, axis1=axis1, axis2=axis2)
- return D.astype(dtype).filled(0).sum(axis=None, out=out)
+ return D.astype(dtype).filled(0).sum(axis=-1, out=out)
trace.__doc__ = ndarray.trace.__doc__
def dot(self, b, out=None, strict=False):