[Numpy-discussion] New numpy functions: filled, filled_like
Fri Jan 18 07:48:36 CST 2013
Le 17/01/2013 23:31, Matthew Brett a écrit :
>> Would it be too weird or clumsy to extend the empty and empty_like functions
>> >to do the filling?
>> >np.empty((10, 10), fill=np.nan)
>> >np.empty_like(my_arr, fill=np.nan)
> That sounds like a good idea to me. Someone wanting a fast way to
> fill an array will probably check out the 'empty' docstring first.
Oh, that sounds very good to me. There is indeed a bit of contradictions
between "empty" and "fill" but maybe not that strong if we think of
"empty" as a "void of actual information". (Especially true when the
fill value is nan or inf, which, as Ben just mentionned are probably the
most commonly used fill value after zero.)
Maybe a keyword named "value" instead of "fill" may help soften the
semantic opposition with "empty" ?
More information about the NumPy-Discussion