[Numpy-discussion] Re: ndarray.fill and ma.array.filled
bsouthey at gmail.com
Mon Apr 10 09:16:08 CDT 2006
On 4/7/06, Sasha <ndarray at mac.com> wrote:
> On 4/7/06, Pierre GM <pgmdevlist at mailcan.com> wrote:
> > ...
> > We're going towards MA as the default object.
> I will be against changing the array structure to handle missing
> values. Let's keep the discussion focuced on the interface. Once we
> agree on the interface, it will be clear if any structural changes are
> > But then again, what would be the behavior to deal with missing values ?
> We can postpone this discussion as well. Just add mask attribute that
> returns False and filled method that returns a copy is an example of a
> minimalistic change.
I think that the usage of MA is important because this often dictates
the interface. The other aspect is the penalty that is imposed by
requiring a masked features especially to situations that don't need
any of these features.
> > Using R-like na.actions ? That'd be great, but it's getting more complex.
> I don't like na.actions. I think missing values should behave like
> IEEE NaNs and in the floating point case should be represented by
I think the issue related to how masked values should be handled in
computation. Does it matter if the result of an operation is due to a
masked value or numerical problem (like dividing by zero)? (I am
presuming that it is possible to identify this difference.) If not,
then I support the idea of treating masked values as NaN.
>The functionality provided by na.actions can always be achieved
> by calling an extra function (filled or compress).
I am not clear on what you actually mean here. For example, if you
are summing across a particular dimension, I would presume that any
masked value would be ignored an that there would be some record of
the fact that a masked value was encountered. This would allow that
'extra function' to handle the associated result. Alternatively the
'extra function' would have to be included as an argument - which is
what the na.actions do.
More information about the Numpy-discussion