[Numpy-discussion] random number facilities in numarray and main Python libs

Faheem Mitha faheem at email.unc.edu
Tue Sep 7 16:09:06 CDT 2004


Dear People,

I recently encountered a strange problem when writing some Python using 
random number code. I tried setting the seed at top level, but I was still 
get random results. I submitted a bug report, and had my error explained 
to me.

I had run into this problem several times, and I think some mental block 
had prevented me from seeing the source of the problem. Part of the reason 
is that I had previously been using R, and everyone uses the same random 
number generator facilities.

Are the random number facilities provided by numarray.random_array 
superior to those provided to those provided by the random module in the 
Python library? They certainly seem more extensive, and I like the 
interface better.

If so, why not replace the random module by the equivalent functionality 
from numarray.random_array, and have everyone use the same random number 
generator? Or is this impossible for practical reasons?

By the way, what is the name of the pseudo-random number generator being 
used? I see that the code is in Packages/RandomArray2/Src, but could not 
see where the name of the generator is mentioned.
                                                                 Faheem.





More information about the Numpy-discussion mailing list