[Numpy-discussion] [SciPy-user] Messing with missing values

Sasha ndarray at mac.com
Sun Feb 26 11:31:57 CST 2006


I am replying on "numpy-discussion"  because this is really a numpy
rather than scipy topic.

> Unfortunately, most of the numpy/scipy functions don't handle missing values
> nicely.

Can you specify which *numpy* functions are giving you trouble?
That should be fixed.

> How could I mask the values corresponding to
> MA.masked in the final list, without having to check every single element?

Latest ma allows you to pass masked arrays directly to ufuncs. In
order for this to work a ufunc should be registered in the "domains"
and "fills" dictionaries.  Not much documentation on this feature
exists yet, so you will have to read the code in ma.py to figure this
out.

> Date: Sat, 25 Feb 2006 18:36:19 -0500
> From: pgmdevlist at mailcan.com
> Subject: [SciPy-user] Messing with missing values
> To: scipy-user at scipy.net
> Message-ID: <200602251836.20406.pgmdevlist at mailcan.com>
> Content-Type: text/plain;  charset="us-ascii"
>
> Folks,
> Most of the data I work with have missing values, and I rely on 'ma' a lot.
> Unfortunately, most of the numpy/scipy functions don't handle missing values
> nicely. Not a problem I thought, I just have to adapt the functions I need.
> I have 2 options: wrapping the initial functions in tests, or recode the
> initial functions.
> * According to your experience, which is the most efficient way to go ?
> * I have a function that outputs either a float or MA.masked. I call this
> function recursively, appending the result to a list, and then trying to
> process the list as an array. How could I mask the values corresponding to
> MA.masked in the final list, without having to check every single element?
>
> Thanks for your ideas




More information about the Numpy-discussion mailing list