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

Christopher Barker Chris.Barker at noaa.gov
Wed Mar 17 15:12:18 EDT 2010

Eric Firing wrote:
> My motivation for going 
> to the C level was speed and control; many ma operations are very slow 
> compared to their numpy counterparts, and moving the mask handling to C 
> can erase nearly all of this penalty.

really? very cool. I was thinking about this the other day, and thinking 
that in some grand future vision, all numpy arrays should be masked 
arrays (or could be). The idea is that missing/invalid data is a really 
common case, and it is simply wonderful to have the software handle that 

One of the things I liked about MATLAB was that NaNs were well handled 
almost all the time. 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. I had thought that there would be a significant 
performance penalty, and thus there would be a boatload of "if_mask" 
code all over the place, but maybe not.

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


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