[Numpy-discussion] minor improvment to ones

Geoffrey Irving irving@naml...
Sun Feb 1 01:20:25 CST 2009


On Fri, Jan 30, 2009 at 5:18 AM, Neal Becker <ndbecker2@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