[Numpy-discussion] MA bug or feature?
michael.sorich at gmail.com
Wed Jun 21 03:46:19 CDT 2006
When transposing a masked array of dtype '<f8' I noticed that an
ndarray of dtype '|O4' was returned. I found this a little strange as
the masked array did not contain any masked values. Upon closer
examination (see script below) it seems that if the mask is a boolean
array with all false values and the fill_value is a string this will
occur. However if the fill_value is a number or the mask is simply
False, the dtype stays as '<f8'. I was going to submit this as a bug
but wanted to check that this was not a deliberate feature.
I am using the numpy version that comes with a recent version of
python enthought edition.
ma1 = numpy.ma.array(((1.,2,3),(4,5,6)), mask=((0,0,0),(0,0,0)))
ma2 = numpy.ma.array(((1.,2,3),(4,5,6)), mask=False)
More information about the Numpy-discussion