[Numpy-discussion] minor improvment to ones

Grissiom chaos.proton at gmail.com
Fri Jan 30 09:07:03 EST 2009


On Fri, Jan 30, 2009 at 21:54, Scott Sinclair
<scott.sinclair.za at gmail.com>wrote:

> > 2009/1/30 David Cournapeau <david at ar.media.kyoto-u.ac.jp>:
> > Neal Becker wrote:
> >> A nit, but it would be nice if 'ones' could fill with a value other than
> 1.
> >>
> >> Maybe an optional val= keyword?
> >
> > What would be the advantage compared to fill ? I would guess ones and
> > zeros are special because those two values are special (they can be
> > defined for many types, as  neutral elements for + and *),
>
> I couldn't find the numpy fill function, until my tiny brain realized
> you meant the ndarray method:
>
> http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.fill.html
>
> Cheers,
> Scott
>

Is fill function has any advantage over ones(size)*x ?

-- 
Cheers,
Grissiom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090130/2e4c9e50/attachment.html>


More information about the NumPy-Discussion mailing list