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

Daniele Nicolodi daniele at grinta.net
Fri Jan 18 03:44:03 EST 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.


Cheers,
Daniele




More information about the NumPy-Discussion mailing list