[SciPy-dev] Random number (mtrand) problems

Andrew Jaffe a.h.jaffe at gmail.com
Fri Dec 2 17:23:58 CST 2005


Hi All,

I've been having with random number generation in the latest iterations 
of scipy_core:


In [1]: from scipy.lib.mtrand import normal
Importing test to scipy
Importing base to scipy
Importing basic to scipy

In [2]: n = normal(0,1)

In [3]: print n
0.421867235737

In [4]: n1 = normal(0,1,1)
Bus error

The problem occurs for any size !=None and for 'uniform', too.

But it's more complicated than that: usually, I get bus errors. 
Sometimes it's slightly different:

 >>> n1 = normal(0,1,1)
 >>> print n1
ValueError: Invalid type for array
 >>> n1
array([  2.90522444e-310])

(the ValueError seems to be happening in array2string)

The difference seems to be related somewhat to whether the name (n1 
above) had already been bound to an object, but I can't figure out the 
general pattern.

Hmmmmm.

A




More information about the Scipy-dev mailing list