numpy.random.set_state()

numpy.random.set_state

numpy.random.set_state(state)

Set the internal state of the generator from a tuple.

For use if one has reason to manually (re-)set the internal state of the “Mersenne Twister”[R261] pseudo-random number generating algorithm.

Parameters:

state : tuple(str, ndarray of 624 uints, int, int, float)

The state tuple has the following items:

  1. the string ‘MT19937’, specifying the Mersenne Twister algorithm.
  2. a 1-D array of 624 unsigned integers keys.
  3. an integer pos.
  4. 登录查看完整内容