[SciPy-dev] Shoud ma.filled change dtype?
ndarray at mac.com
Sun Jan 8 00:12:59 CST 2006
In the current version of numpy.core.ma, masked values can be filled
by arbitrary value. If the fill value cannot be converted to an
appropriate type, an object array is returned:
>>> from numpy.core.ma import *
>>> x = array(,mask=)
Note that in the example the resulting array is an object array with
complex numbers in it. This creature is very similar in behavior to a
complex array, but is slower and takes many times more memory. If real
x was filled with a complex number by mistake, this mistake is likely
to go unnoticed.
I don't think this feature is useful and I've just spent a day chasing
a bug related to this feature. If one really wants to create an object
array from a masked array of numbers, it is easy to convert the array
explicitely. (With the current implementation this will also be a
There is probably some history behind this feature. If so, can
someone educate me?
More information about the Scipy-dev