[Numpy-discussion] change the mask state of one element in a masked array

2012-02-18 Thread Chao YUE
Dear all, I built a new empty masked array: In [91]: a=np.ma.empty((2,5)) In [92]: a Out[92]: masked_array(data = [[ 1.20569155e-312 3.34730819e-316 1.13580079e-316 1.11459945e-316 9.69610549e-317] [ 6.94900258e-310 8.48292532e-317 6.94900258e-310 9.76397825e-317

Re: [Numpy-discussion] change the mask state of one element in a masked array

2012-02-18 Thread Olivier Delalleau
There may be a better way to do it, but you can first do: a.mask = np.zeros_like(a) then afterwards e.g. a.mask[0, 0] = True will work. -=- Olivier Le 18 février 2012 10:52, Chao YUE chaoyue...@gmail.com a écrit : Dear all, I built a new empty masked array: In [91]: a=np.ma.empty((2,5))

Re: [Numpy-discussion] change the mask state of one element in a masked array

2012-02-18 Thread Eric Firing
On 02/18/2012 05:52 AM, Chao YUE wrote: Dear all, I built a new empty masked array: In [91]: a=np.ma.empty((2,5)) Of course this only makes sense if you are going to immediately populate the array. In [92]: a Out[92]: masked_array(data = [[ 1.20569155e-312 3.34730819e-316