[Numpy-discussion] masked arrays

Pierre GM pgmdevlist at mailcan.com
Wed May 31 09:45:00 EDT 2006


On Wednesday 31 May 2006 10:25, John Hunter wrote:
> I'm a bit of an ma newbie.  I have a 2D masked array R and want to
> extract the non-masked values in the last column.  Below I use logical
> indexing, but I suspect there is a "built-in" way w/ masked arrays.  I
> read through the docstring, but didn't see anything better.

R[:,-1].compressed() should do the trick. 




More information about the NumPy-Discussion mailing list