# [Numpy-discussion] RandomArray - random

Paul F. Dubois paul at pfdubois.com
Sun Nov 11 09:14:02 CST 2001

Your reference to random is not fully qualified so I suppose you could
be picking up some other random. But I just tried
RandomArray.random((2,3)) and it worked fine.

BTW you could just do 2.0*random((n,m))-1.0.

-----Original Message-----
[mailto:numpy-discussion-admin at lists.sourceforge.net] On Behalf Of Nils
Wagner
Sent: Sunday, November 11, 2001 8:34 AM
To: numpy-discussion at lists.sourceforge.net
Subject: [Numpy-discussion] RandomArray - random

Hi,

I tried to produce a random matrix say Q (2ndof \times nsamp+1) with
Numpy 20.2 and Python 2.1.1 (#1, Sep 24 2001, 05:28:47) [GCC 2.95.3

Traceback (most recent call last):
File "modal.py", line 192, in ?
Q = 2.0*random((2*ndof,nsamp+1))-ones((2*ndof,nsamp+1))
TypeError: random() takes exactly 1 argument (2 given)

Does it require a new syntax to obtain a matrix consisting of uniformly
distributed random numbers in the range +/- 1 ?

Nils

_______________________________________________
Numpy-discussion mailing list Numpy-discussion at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion