[Numpy-discussion] minor improvment to ones

Geoffrey Irving irving at naml.us
Sun Feb 1 02:20:25 EST 2009


On Fri, Jan 30, 2009 at 5:18 AM, Neal Becker <ndbecker2 at gmail.com> wrote:
> A nit, but it would be nice if 'ones' could fill with a value other than 1.
>
> Maybe an optional val= keyword?

You can use the "tile" function for this.  "tile(3,3)" creates an
array of 3 3's.

Geoffrey



More information about the NumPy-Discussion mailing list