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

Daniele Nicolodi daniele@grinta....
Fri Jan 18 02:44:03 CST 2013

On 17/01/2013 23:27, Mark Wiebe wrote:
> 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)

Wouldn't it be more natural to extend the ndarray constructor?

np.ndarray((10, 10), fill=np.nan)

It looks more natural to me. In this way it is not possible to have the
_like extension, but I don't see it as a major drawback.


More information about the NumPy-Discussion mailing list