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

Robert Kern robert.kern at gmail.com
Mon Jan 14 10:32:27 EST 2013


On Mon, Jan 14, 2013 at 4:12 PM, Frédéric Bastien <nouiz at nouiz.org> wrote:
> Why not optimize NumPy to detect a mul of an ndarray by a scalar to
> call fill? That way, "np.empty * 2" will be as fast as "x=np.empty;
> x.fill(2)"?

In general, each element of an array will be different, so the result
of the multiplication will be different, so fill can not be used.

--
Robert Kern



More information about the NumPy-Discussion mailing list