[Numpy-discussion] take not respecting masked arrays?
Charles R Harris
Sun Feb 28 22:12:13 CST 2010
On Sun, Feb 28, 2010 at 9:01 PM, Pierre GM <email@example.com> wrote:
> On Feb 28, 2010, at 8:59 PM, Peter Shinners wrote:
> > I have a 2D masked array that has indices into a 1D array. I want to use
> > some form of "take" to fetch the values into the 2D array. I've tried
> > both numpy.take and numpy.ma.take, but they both return a new unmasked
> > array.
> Mmh. Surprising. np.ma.take should return a masked array if it's given a
> masked array as input. Can you pastebin the array that gives you trouble ? I
> need to investigate that.
> As a temporary workaround, use np.take on first the _data, then the _mask
> and construct a new masked array from the two results.
Ah, Pierre, now that you are here... ;) Can you take a look at the invalid
value warnings in the masked array tests and maybe fix them up by turning
off the warnings where appropriate? I'd do it myself except that I hesitate
to touch masked array stuff.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion