[Numpy-discussion] take not respecting masked arrays?

Charles R Harris charlesr.harris at gmail.com
Sun Feb 28 23:12:13 EST 2010


On Sun, Feb 28, 2010 at 9:01 PM, Pierre GM <pgmdevlist at gmail.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.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20100228/8f9a96c2/attachment.html>


More information about the NumPy-Discussion mailing list