summaryrefslogtreecommitdiff
path: root/numpy/core/ma.py
diff options
context:
space:
mode:
authorsasha <sasha@localhost>2006-01-20 00:21:47 +0000
committersasha <sasha@localhost>2006-01-20 00:21:47 +0000
commit01597c2bbe93f5d444355fd6efe5322da53bc770 (patch)
treee2c8ddbc7a279fc7df56a30bcc7bcbb12708816f /numpy/core/ma.py
parent39edf8031bbbaad86b85195e0db3090ad9c9f681 (diff)
downloadnumpy-01597c2bbe93f5d444355fd6efe5322da53bc770.tar.gz
Made ma immune to a bug in choose
Diffstat (limited to 'numpy/core/ma.py')
-rw-r--r--numpy/core/ma.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/numpy/core/ma.py b/numpy/core/ma.py
index f7024d4a8..2f0f7224d 100644
--- a/numpy/core/ma.py
+++ b/numpy/core/ma.py
@@ -1707,20 +1707,12 @@ def where (condition, x, y):
the value masked.
"""
fc = filled(not_equal(condition,0), 0)
- if x is masked:
- xv = 0
- xm = 1
- else:
- xv = filled(x)
- xm = getmask(x)
- if xm is nomask: xm = 0
- if y is masked:
- yv = 0
- ym = 1
- else:
- yv = filled(y)
- ym = getmask(y)
- if ym is nomask: ym = 0
+ xv = filled(x)
+ xm = getmask(x)
+ if xm is nomask: xm = numeric.False_
+ yv = filled(y)
+ ym = getmask(y)
+ if ym is nomask: ym = numeric.False_
d = numeric.choose(fc, (yv, xv))
md = numeric.choose(fc, (ym, xm))
m = getmask(condition)