summaryrefslogtreecommitdiff
path: root/numpy/ma/extras.py
diff options
context:
space:
mode:
authorAlexander Belopolsky <a@enlnt.com>2015-03-22 21:15:59 -0400
committerAlexander Belopolsky <a@enlnt.com>2015-03-22 21:15:59 -0400
commit3fdf1883369c5cd40ad7022ad46a629f2284a7a3 (patch)
tree131ebd2558bed692ff5e0f3eb759a8d12e6e1219 /numpy/ma/extras.py
parente3101647ef7c262fa6b4ddc8fdf79453f8a1e05c (diff)
downloadnumpy-3fdf1883369c5cd40ad7022ad46a629f2284a7a3.tar.gz
BUG: Implemented MaskedArray.dot
MaskedArray used to inherit ndarray.dot which ignored masks in the operands. Fixes issue #5185.
Diffstat (limited to 'numpy/ma/extras.py')
-rw-r--r--numpy/ma/extras.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index 6d812964d..d389099ae 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -1047,13 +1047,7 @@ def dot(a, b, strict=False):
if strict and (a.ndim == 2) and (b.ndim == 2):
a = mask_rows(a)
b = mask_cols(b)
- #
- d = np.dot(filled(a, 0), filled(b, 0))
- #
- am = (~getmaskarray(a))
- bm = (~getmaskarray(b))
- m = ~np.dot(am, bm)
- return masked_array(d, mask=m)
+ return a.dot(b)
#####--------------------------------------------------------------------------
#---- --- arraysetops ---