class numpy.random.mtrand.RandomState

Container for the Mersenne Twister PRNG.

RandomState exposes a number of methods for generating random numbers drawn from a variety of probability distributions. In addition to the distribution-specific arguments, each method takes a keyword argument size that defaults to None. If size is None, then a single value is generated and returned. If size is an integer, then a 1-D numpy array filled with generated values is returned. If size is a tuple, then a numpy array with that shape is filled and returned.


seed : array_like, int, optional

Random seed initializing the PRNG. Can be an integer, an array (or other sequence) of integers of any length, or None. If seed is None, then RandomState will try to read data from /dev/urandom (or the Windows analogue) if available or seed from the clock otherwise.

Previous topic


Next topic


This Page

Quick search