> 2009/7/4 Ben Park :
>
> 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
In some situations ravel has to return a copy of the data instead of a
view. You'r
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