[Numpy-discussion] bug with with fill_values in masked arrays?

Chris Withers chris at simplistix.co.uk
Thu Mar 20 19:06:32 EDT 2008


Matt Knox wrote:
>> 1. why am I not getting my NaN's back?
> 
> when iterating over a masked array, you get the "ma.masked" constant for
> elements that were masked (same as what you would get if you indexed the masked
> array at that element). If you are referring specifically to the .data portion
> of the array... it looks like the latest version of the numpy.ma sub-module
> preserves nan's in the data portion of the masked array, but the old version
> perhaps doesn't based on the output you are showing.

OK, when's this going to make it into a release?

>> 2. why is the wrong fill value being used here?
> 
> the second element in the array iteration here is actually the numpy.ma.masked
> constant, which always has the same fill value (which I guess is 999999). 

This sucks to the point of feeling like a bug :-(

Why is it desirable for it to behave like this?

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the NumPy-Discussion mailing list