[Numpy-discussion] ndarray.fill and ma.array.filled
michael.sorich at gmail.com
Thu Mar 23 15:27:11 CST 2006
On 3/23/06, Sasha <ndarray at mac.com> wrote:
> In an ideal world, any function that accepts ndarray would accept
> ma.array and vice versa. Moreover, if the ma.array has no masked
> elements and the same data as ndarray, the result should be the same.
> Obviously current implementation falls short of this goal, but there
> is one feature that seems to make this goal unachievable.
I am just starting to use ma.array and would like to get some idea from
those in the know of how close this is to reality. What percentage of
functions designed for nd_arrays would work on a ma.array with no masked
elements? That is if you have data with missing values, but then remove the
missing values, is it necessary to convert back to a standard nd_array?
The statistical language R deals with missing data fairly well. There are a
number of functions for dealing with missing values (fail, omit, exclude,
pass). Furthermore, there is a relatively standard way for a function to
handle data with missing values, via an na.action parameter which indicates
which function to call.
It would be nice to have a similar set of functions (including the fill
function) for numpy. These functions could return the object without change
if it is not a masked array, and if a masked array make the appropriate
changes to return a nd_array or raise exception. A simple standard for
indicating a function's the ability to handle masked data would be to
include a mask_action parameter which holds or indicates a function for
processing missing data.
Also, are there any current plans to allow record type arrays to be masked?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion