[Numpy-discussion] Args for rand and randn: call for a vote

Paul Barrett pebarrett at gmail.com
Sat Jul 8 09:31:20 EDT 2006


On 7/8/06, Ed Schofield <schofield at ftw.at> wrote:
>
> Last week's discussion on rand() and randn() seemed to indicate a
> sentiment that they ought to take tuples for consistency with ones,
> zeros, eye, identity, and empty -- that, although they are supposed
> to be convenience functions, they are inconvenient precisely because
> of their inconsistency with these other functions.  This issue has
> been raised many times over the past several months.
>
> Travis made a change in r2572 to allow tuples as arguments, then took
> it out again a few hours later, apparently unsure about whether this
> was a good idea.
>
> I'd like to call for a vote on what people would prefer, and then ask
> Travis to make a final pronouncement before the feature freeze.
>
>
>
>
> * Should numpy.rand and numpy.randn accept sequences of dimensions as
> arguments, like rand((3,3)), as an alternative to rand(3,3)?

+1     --- I'm all for consistency!

> OR
>
>
> * Should rand((3,3)) and randn((3,3)) continue to raise a TypeError?




More information about the NumPy-Discussion mailing list