Reproducibility of python pseudo-random numbers across systems and versions?

后端 未结 5 691
后悔当初
后悔当初 2020-12-20 12:08

I need to generate a controlled sequence of pseudo-random numbers, given an initial parameter. For that I\'m using the standard python random generator, seeded by this param

5条回答
  •  礼貌的吻别
    2020-12-20 12:46

    Not necessarily.

    As described in the documentation, the random module has used the Mersenne twister to generate random numbers since version 2.3, but used Wichmann-Hill before that.

    (If a seed is not provided, the method of obtaining the seed also does depend on the operating system, the Python version, and factors such as the system time).

提交回复
热议问题