[Numpy-discussion] New numpy functions: filled, filled_like

Pierre Haessig pierre.haessig@crans....
Mon Jan 14 06:38:46 CST 2013


Hi,

Le 14/01/2013 00:39, Nathaniel Smith a écrit :
> (The nice thing about np.filled() is that it makes np.zeros() and
> np.ones() feel like clutter, rather than the reverse... not that I'm
> suggesting ever getting rid of them, but it makes the API conceptually
> feel smaller, not larger.)
Coming from the Matlab syntax, I feel that np.zeros and np.ones are in
numpy for Matlab (and maybe others ?) compatibilty and are useful for
that. Now that I've been "enlightened" by Python, I think that those
functions (especially np.ones) are indeed clutter. Therefore I favor the
introduction of these two new functions.

However, I think Eric's remark about masked array API compatibility is
important. I don't know what other names are possible ? np.const ?

Or maybe np.tile is also useful for that same purpose ? In that case
adding a dtype argument to np.tile would be useful.

best,
Pierre

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130114/e962a824/attachment-0001.bin 


More information about the NumPy-Discussion mailing list