[Numpy-discussion] Re: ndarray.fill and ma.array.filled

Sasha ndarray at mac.com
Fri Apr 7 12:20:15 CDT 2006

On 4/7/06, Tim Hochberg <tim.hochberg at cox.net> wrote:
> ...
> In general, I'm skeptical of adding more methods to the ndarray object
> -- there are plenty already.

I've also proposed to drop "fill" in favor of optimizing x[...] = <scalar>.
Having both "fill" and "filled" in the interface is plain awkward.  You may
like the combined proposal better because it does not change the total
number of methods :-)

In addition, it appears that both the method and function versions of
> filled are "dangerous" in the sense that they sometimes return the array
> itself and sometimes a copy.

This is true in ma, but may certainly be changed.

> Finally, changing ndarray to support masked array feels a bit like the
> tail wagging the dog.

I disagree. Numpy is pretty much alone among the array languages because it
does not have "native" support for missing values. For the  floating point
types some rudimental support for nans exists, but is not really usable.
There is no missing values machanism for integer types.  I believe adding
"filled" and maybe "mask" to ndarray (not necessarily under these names)
could be a meaningful step towards "native" support for missing values.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20060407/8161ae4c/attachment.html 

More information about the Numpy-discussion mailing list