[Numpy-discussion] Questions about masked arrays

Pierre GM pgmdevlist at gmail.com
Wed Oct 7 00:33:00 EDT 2009


On Oct 7, 2009, at 12:10 AM, Gökhan Sever wrote:

> Created the ticket http://projects.scipy.org/numpy/ticket/1253

Want even more confusion ?
 >>> x = ma.array([1,2,3],mask=[0,1,0], dtype=int)
 >>> x[0].dtype
dtype('int64')
 >>> x[1].dtype
dtype('float64')
 >>> x[2].dtype
dtype('int64')

Yet another illustration of the masked constant... The more I think  
about it, the more I think we should have a specific object  
("MaskedConstant") that would do nothing but tell us that it is masked.


> Could you tell me briefly what was the source of leak in arccos case?

No idea, as I still haven't figured why you were having the problem in  
the first place

> And how do you write a test code for these cases?

assert(np.arccos(ma.masked), ma.masked) would be the simplest.






More information about the NumPy-Discussion mailing list