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: the string ?MT19937?, specifying the Mersenne Twister algorithm. a 1-D array of 624 unsigned integers keys. an integer pos. an integer has_gauss. a float cac

numpy.random.shuffle()

numpy.random.shuffle(x) Modify a sequence in-place by shuffling its contents. Parameters: x : array_like The array or list to be shuffled. Returns: None Examples >>> arr = np.arange(10) >>> np.random.shuffle(arr) >>> arr [1 7 5 2 9 4 3 6 0 8] This function only shuffles the array along the first index of a multi-dimensional array: >>> arr = np.arange(9).reshape((3, 3)) >>> np.random.shuffle(arr) >>> arr array([[3, 4, 5], [6

numpy.random.sample()

numpy.random.sample(size=None) Return random floats in the half-open interval [0.0, 1.0). Results are from the ?continuous uniform? distribution over the stated interval. To sample multiply the output of random_sample by (b-a) and add a: (b - a) * random_sample() + a Parameters: size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned. Returns: out : float or

numpy.random.seed()

numpy.random.seed(seed=None) Seed the generator. This method is called when RandomState is initialized. It can be called again to re-seed the generator. For details, see RandomState. Parameters: seed : int or array_like, optional Seed for RandomState. Must be convertible to 32 bit unsigned integers. See also RandomState

numpy.random.rayleigh()

numpy.random.rayleigh(scale=1.0, size=None) Draw samples from a Rayleigh distribution. The and Weibull distributions are generalizations of the Rayleigh. Parameters: scale : scalar Scale, also equals the mode. Should be >= 0. size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned. Notes The probability density function for the Rayleigh distribution is

numpy.random.ranf()

numpy.random.ranf(size=None) Return random floats in the half-open interval [0.0, 1.0). Results are from the ?continuous uniform? distribution over the stated interval. To sample multiply the output of random_sample by (b-a) and add a: (b - a) * random_sample() + a Parameters: size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned. Returns: out : float or n

numpy.random.RandomState

class numpy.random.RandomState Container for the Mersenne Twister pseudo-random number generator. 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 array filled with generated values is returned. If size is a

numpy.random.random_integers()

numpy.random.random_integers(low, high=None, size=None) Random integers of type np.int between low and high, inclusive. Return random integers of type np.int from the ?discrete uniform? distribution in the closed interval [low, high]. If high is None (the default), then results are from [1, low]. The np.int type translates to the C long type used by Python 2 for ?short? integers and its precision is platform dependent. This function has been deprecated. Use randint instead. Deprecated sinc

numpy.random.random_sample()

numpy.random.random_sample(size=None) Return random floats in the half-open interval [0.0, 1.0). Results are from the ?continuous uniform? distribution over the stated interval. To sample multiply the output of random_sample by (b-a) and add a: (b - a) * random_sample() + a Parameters: size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned. Returns: out : f

numpy.random.random()

numpy.random.random(size=None) Return random floats in the half-open interval [0.0, 1.0). Results are from the ?continuous uniform? distribution over the stated interval. To sample multiply the output of random_sample by (b-a) and add a: (b - a) * random_sample() + a Parameters: size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. Default is None, in which case a single value is returned. Returns: out : float or