> 2009/7/8 Robert Kern <[email protected]>:
> 2009/7/4 Stéfan van der Walt <[email protected]>:
>> Thanks, Scott. This should now be fixed in SVN.
>
> You should probably change that to asanyarray() before the masked
> array crowd gets upset. :-)
I hadn't thought about that, but I'm don't think it matters in this
case. MaskedArray.nonzero() returns a tuple of ndarrays...
>>> import numpy as np
>>> a = np.ma.array([4,0,2,1,3])
>>> a
masked_array(data = [4 0 2 1 3],
mask = False,
fill_value = 999999)
>>> np.asarray(a)
array([4, 0, 2, 1, 3])
>>> np.asarray(a).nonzero()
(array([0, 2, 3, 4]),)
>>> np.asanyarray(a)
masked_array(data = [4 0 2 1 3],
mask = False,
fill_value = 999999)
>>> np.asanyarray(a).nonzero()
(array([0, 2, 3, 4]),)
Cheers,
Scott
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion