summaryrefslogtreecommitdiff
path: root/numpy/core/ma.py
diff options
context:
space:
mode:
authorsasha <sasha@localhost>2006-01-08 05:39:19 +0000
committersasha <sasha@localhost>2006-01-08 05:39:19 +0000
commitb12fbb15a6d920272a7073a4c08cd4a3f57d6d56 (patch)
tree90e291f4b8887354e735ef86874570b6baa8d5ea /numpy/core/ma.py
parent158925966f1796d93ab804f3ebecec7b524e70f4 (diff)
downloadnumpy-b12fbb15a6d920272a7073a4c08cd4a3f57d6d56.tar.gz
Fixed the following bug:
>>> from numpy.core.ma import * >>> array(1,mask=0).filled().dtype <type 'object_arrtype'> Now: >>> array(1,mask=0).filled().dtype <type 'int32_arrtype'>
Diffstat (limited to 'numpy/core/ma.py')
-rw-r--r--numpy/core/ma.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/core/ma.py b/numpy/core/ma.py
index 063baa455..52447d236 100644
--- a/numpy/core/ma.py
+++ b/numpy/core/ma.py
@@ -1215,11 +1215,17 @@ array(data = %(data)s,
try:
result = numeric.array(d, dtype=d.dtype, copy=1)
result[m] = value
- except:
+ except (TypeError, AttributeError):
#ok, can't put that value in here
value = numeric.array(value, dtype=object)
d = d.astype(object)
result = oldnumeric.choose(m, (d, value))
+ except IndexError:
+ #ok, if scalar
+ if d.shape:
+ raise
+ else:
+ result = numeric.array(value, dtype=d.dtype)
return result
def ids (self):