[Numpy-discussion] Warnings in numpy.ma.test()

Christopher Barker Chris.Barker at noaa.gov
Thu Mar 18 15:12:10 EDT 2010

josef.pktd at gmail.com wrote:
> On Wed, Mar 17, 2010 at 3:12 PM, Christopher Barker

>> Given all the limitations of NaN, having a masked
>> array is a better way to go, but I'd love it if they were "just there",
>> and therefore EVERY numpy function and package built on numpy would
>> handle them gracefully.

> many function are defined differently for missing values, in stats,
> regression or time series analysis with the assumption of equally
> spaced time periods always needs to use special methods to handle
> missing values.

sure -- that's kind of my point -- if EVERY numpy array were 
(potentially) masked, then folks would write code to deal with them 

> Plus, you have to operate on two arrays and keep both in memory. So
> the penalty is pretty high even in C.

Only if there is actually a mask, which might make this pretty ugly -- 
lots of "if mask" code branching.

If a given routine either didn't make sense with missing values, or was 
simply too costly with them, it could certainly raise an exception if it 
got an array with a non-null mask.

>> Anyway, just a fantasy, but C-level ufuncs that support masks would be
>> great.

Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov

More information about the NumPy-Discussion mailing list