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

Pau Gargallo pau.gargallo at gmail.com
Sat Jul 8 18:59:38 EDT 2006


On 7/8/06, Robert Kern <robert.kern at gmail.com> wrote:
> Ed Schofield wrote:
> > * Should numpy.rand and numpy.randn accept sequences of dimensions as
> > arguments, like rand((3,3)), as an alternative to rand(3,3)?
>
> > * Should rand((3,3)) and randn((3,3)) continue to raise a TypeError?
>
> This is a false dichotomy. There are more choices here.
>
> * Remove rand and randn (at least from the toplevel namespace) and promote the
> use of random_sample and standard_normal which already follow the tuple convention.
>

i just wanted to point out another possible choice:

  * enable numpy.rand((3,3)) and make numpy.rand(3,3) raise an error
as zeros and ones do.

I suppose that you all discussed a lot about this choice also, but it
still seems very reasonable to me :-(

pau




More information about the NumPy-Discussion mailing list