> Ouch… > Quick workaround: use `x.harden_mask()` *then* `x.mask.flags.writeable=False`
Thanks for the update and the detailed explanation. I'll try this trick. > This may change in the future, depending on a yet-to-be-achieved consensus on > the definition of 'least-surprising behaviour'. Right now, the *-like > functions return an array that shares the mask with the input, as you've > noticed. Some people complained about it, what's your take on that? I already took part in the survey (possibly out of thread): http://mail.scipy.org/pipermail/numpy-discussion/2013-July/067136.html > You were not missing anything, np.ma isn't the most straightforward module: > plenty of corner cases, and the implementation is pretty naive at times (but > hey, it works). My only advice is to never lose hope. I agree there are plenty of hard-to-define cases, and I came accross a hot debate on missing data representation in python: https://github.com/njsmith/numpy/wiki/NA-discussion-status but still I believe np.ma is very usable when compression is not strongly needed. _______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
