[Numpy-discussion] RandomArray - random

Nils Wagner nwagner at mecha.uni-stuttgart.de
Mon Nov 12 04:01:03 CST 2001


"Paul F. Dubois" schrieb:
> 
> 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.
> 
It seems to be a conflict with Vpython formerly Visualpython. 
http://cil.andrew.cmu.edu/projects/visual/index.html

Python 2.1.1 (#1, Sep 24 2001, 05:28:47)
[GCC 2.95.3 20010315 (SuSE)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> from Numeric import *
>>> from RandomArray import *
>>> random((2,3))
array([[ 0.68769461,  0.33015978,  0.07285815],
       [ 0.20514929,  0.81925279,  0.50694615]])
>>> from visual import *
Visual-2001-09-24
>>> random((2,3))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: random() takes exactly 1 argument (2 given)
>>>

Nils

> -----Original Message-----
> From: numpy-discussion-admin at lists.sourceforge.net
> [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
> 20010315 (SuSE)] on linux2 Type "copyright", "credits" or "license" for
> more information.
> 
> 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
> 
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion




More information about the Numpy-discussion mailing list