[Numpy-discussion] assigning ma.masked. Strange behavior

Ben Park benparkla at gmail.com
Sat Jul 4 13:53:27 EDT 2009


import numpy as np
import numpy.ma as ma

# There is no effect on the following assignment of ma.masked.
a1 = ma.arange(10).reshape((2,5))
a1.ravel()[np.array([0,2,2])] = ma.masked

# The following works:
a1 = ma.arange(10)
a1[np.array([0,2,2])] = ma.masked
a1.shape = 2,5




-- 
View this message in context: http://www.nabble.com/assigning-ma.masked.-Strange-behavior-tp24336615p24336615.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.




More information about the NumPy-Discussion mailing list