2009/9/21 Ernest Adrogué <eadro...@gmx.net> > 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 = 999999) > > When you make an assignemnt in the vein of x[x == 0] = 25 > the result can be a bit puzzling: > > In [21]: x[x == 0] = 25 > > In [22]: x > Out[22]: > masked_array(data = [25 25 25 25 2], > mask = [False False False False False], > fill_value = 999999) > > Is this the correct result or have I found a bug? >
I see the same here on 1.4.0.dev7400. Seems pretty odd to me. Then again, it's a bit more complex using masked boolean arrays for indexing since you have True, False, and masked values. Anyone have thoughts on what *should* happen here? Or is this it? Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion