[Numpy-discussion] random number generation in python compared to gsl

Robert Kern robert.kern@gmail....
Wed Nov 5 12:01:03 CST 2008

On Wed, Nov 5, 2008 at 08:05, Giovanni Samaey
<giovanni.samaey@cs.kuleuven.be> wrote:
>> Hi,
>> how about other seed values ?  I thought seed=0, is (often) used to
>> mean a "random", i.e. current time or alike, seed value ... !?
> Not in this case: I always get the same sequence with seed=0
> (different for both implementation, but the same each time I run it.)
> I got around it by installing pygsl and taking random numbers from
> there instead of from numpy.
> But I still find it strange to get two different sequences from two
> implementation that claim to be the same algorithm...

GSL has this bit of code:

  if (s == 0)
    s = 4357;   /* the default seed is 4357 */

We don't. Otherwise, I believe the two seeding algorithms are identical.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the Numpy-discussion mailing list