diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-09-27 01:37:34 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-09-27 01:39:04 -0700 |
commit | f01d1a6a5c381a4406d92db2993bf01b8e849b8c (patch) | |
tree | bb09941ffbcae53d40009e182dd7846865606dd1 /numpy/ma/core.py | |
parent | 7666d14a5b5c2d94ddb064db83e85d8b8656c7d5 (diff) | |
download | numpy-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.py | 2 |
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): |