randomstate.prng.pcg32.set_state

randomstate.prng.pcg32.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 pseudo-random number generating algorithm.

Parameters:state (dict or tuple) –

The state dictionary should have the following keys

  • name: the string containing the PRNG type.
  • state tuple containing the PRNG-specific state
  • gauss: a dict with two items :has_gauss and cached_gaussian
  • gauss_float: a dict with two items :has_gauss and cached_gaussian
  • uint32: a dict with two items :has_uint32 and uint32
  • seed: the seed used to initialize the RandomState object
  • version: The version of the RandomState object (not currently used)
Returns:out – Returns ‘None’ on success.
Return type:None

See also

get_state()

Notes

set_state and get_state are not needed to work with any of the random distributions in NumPy. If the internal state is manually altered, the user should know exactly what he/she is doing.

For information about the specific structure of the PRNG-specific component, see the class documentation.