On Sep 21, 2009, at 4:23 PM, Ernest Adrogué wrote:
>
> This explains why x[x == 3] = 4 works "as expected", whereas
> x[x == 0] = 4 ruins everything. Basically, any condition that matches
> 0 will match every masked item as well.
There's room for improvement here indeed. I need to check first
w
21/09/09 @ 14:43 (-0400), thus spake Pierre GM:
>
>
> On Sep 21, 2009, at 12:17 PM, Ryan May wrote:
>
> > 2009/9/21 Ernest Adrogué
> > Hello there,
> >
> > Given a masked array such as this one:
> >
> > In [19]: x = np.ma.masked_equal([-1, -1, 0, -1, 2], -1)
> >
> > In [20]: x
> > Out[20]:
> >
On Sep 21, 2009, at 12:17 PM, Ryan May wrote:
> 2009/9/21 Ernest Adrogué
> Hello there,
>
> Given a masked array such as this one:
>
> In [19]: x = np.ma.masked_equal([-1, -1, 0, -1, 2], -1)
>
> In [20]: x
> Out[20]:
> masked_array(data = [-- -- 0 -- 2],
> mask = [ True True False
2009/9/21 Ernest Adrogué
> Hello there,
>
> Given a masked array such as this one:
>
> In [19]: x = np.ma.masked_equal([-1, -1, 0, -1, 2], -1)
>
> In [20]: x
> Out[20]:
> masked_array(data = [-- -- 0 -- 2],
> mask = [ True True False True False],
> fill_value = 99)
>
> Whe
Hello there,
Given a masked array such as this one:
In [19]: x = np.ma.masked_equal([-1, -1, 0, -1, 2], -1)
In [20]: x
Out[20]:
masked_array(data = [-- -- 0 -- 2],
mask = [ True True False True False],
fill_value = 99)
When you make an assignemnt in the vein of x[x ==