doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
numpy.random.Generator.poisson method random.Generator.poisson(lam=1.0, size=None) Draw samples from a Poisson distribution. The Poisson distribution is the limit of the binomial distribution for large N. Parameters lamfloat or array_like of floats Expected number of events occurring in a fixed-time interval,...
numpy.reference.random.generated.numpy.random.generator.poisson
numpy.random.Generator.power method random.Generator.power(a, size=None) Draws samples in [0, 1] from a power distribution with positive exponent a - 1. Also known as the power function distribution. Parameters afloat or array_like of floats Parameter of the distribution. Must be non-negative. sizeint or tu...
numpy.reference.random.generated.numpy.random.generator.power
numpy.random.Generator.random method random.Generator.random(size=None, dtype=np.float64, out=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 \(Unif[a, b), b > a\) multiply the output of random by (b-a) and a...
numpy.reference.random.generated.numpy.random.generator.random
numpy.random.Generator.rayleigh method random.Generator.rayleigh(scale=1.0, size=None) Draw samples from a Rayleigh distribution. The \(\chi\) and Weibull distributions are generalizations of the Rayleigh. Parameters scalefloat or array_like of floats, optional Scale, also equals the mode. Must be non-negativ...
numpy.reference.random.generated.numpy.random.generator.rayleigh
numpy.random.Generator.shuffle method random.Generator.shuffle(x, axis=0) Modify an array or sequence in-place by shuffling its contents. The order of sub-arrays is changed but their contents remains the same. Parameters xndarray or MutableSequence The array, list or mutable sequence to be shuffled. axisint...
numpy.reference.random.generated.numpy.random.generator.shuffle
numpy.random.Generator.standard_cauchy method random.Generator.standard_cauchy(size=None) Draw samples from a standard Cauchy distribution with mode = 0. Also known as the Lorentz distribution. Parameters sizeint or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k s...
numpy.reference.random.generated.numpy.random.generator.standard_cauchy
numpy.random.Generator.standard_exponential method random.Generator.standard_exponential(size=None, dtype=np.float64, method='zig', out=None) Draw samples from the standard exponential distribution. standard_exponential is identical to the exponential distribution with a scale parameter of 1. Parameters sizeint...
numpy.reference.random.generated.numpy.random.generator.standard_exponential
numpy.random.Generator.standard_gamma method random.Generator.standard_gamma(shape, size=None, dtype=np.float64, out=None) Draw samples from a standard Gamma distribution. Samples are drawn from a Gamma distribution with specified parameters, shape (sometimes designated “k”) and scale=1. Parameters shapefloat o...
numpy.reference.random.generated.numpy.random.generator.standard_gamma
numpy.random.Generator.standard_normal method random.Generator.standard_normal(size=None, dtype=np.float64, out=None) Draw samples from a standard Normal distribution (mean=0, stdev=1). Parameters sizeint or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples a...
numpy.reference.random.generated.numpy.random.generator.standard_normal
numpy.random.Generator.standard_t method random.Generator.standard_t(df, size=None) Draw samples from a standard Student’s t distribution with df degrees of freedom. A special case of the hyperbolic distribution. As df gets large, the result resembles that of the standard normal distribution (standard_normal). Par...
numpy.reference.random.generated.numpy.random.generator.standard_t
numpy.random.Generator.triangular method random.Generator.triangular(left, mode, right, size=None) Draw samples from the triangular distribution over the interval [left, right]. The triangular distribution is a continuous probability distribution with lower limit left, peak at mode, and upper limit right. Unlike th...
numpy.reference.random.generated.numpy.random.generator.triangular
numpy.random.Generator.uniform method random.Generator.uniform(low=0.0, high=1.0, size=None) Draw samples from a uniform distribution. Samples are uniformly distributed over the half-open interval [low, high) (includes low, but excludes high). In other words, any value within the given interval is equally likely to...
numpy.reference.random.generated.numpy.random.generator.uniform
numpy.random.Generator.vonmises method random.Generator.vonmises(mu, kappa, size=None) Draw samples from a von Mises distribution. Samples are drawn from a von Mises distribution with specified mode (mu) and dispersion (kappa), on the interval [-pi, pi]. The von Mises distribution (also known as the circular normal...
numpy.reference.random.generated.numpy.random.generator.vonmises
numpy.random.Generator.wald method random.Generator.wald(mean, scale, size=None) Draw samples from a Wald, or inverse Gaussian, distribution. As the scale approaches infinity, the distribution becomes more like a Gaussian. Some references claim that the Wald is an inverse Gaussian with mean equal to 1, but this is ...
numpy.reference.random.generated.numpy.random.generator.wald
numpy.random.Generator.weibull method random.Generator.weibull(a, size=None) Draw samples from a Weibull distribution. Draw samples from a 1-parameter Weibull distribution with the given shape parameter a. \[X = (-ln(U))^{1/a}\] Here, U is drawn from the uniform distribution over (0,1]. The more common 2-parameter...
numpy.reference.random.generated.numpy.random.generator.weibull
numpy.random.Generator.zipf method random.Generator.zipf(a, size=None) Draw samples from a Zipf distribution. Samples are drawn from a Zipf distribution with specified parameter a > 1. The Zipf distribution (also known as the zeta distribution) is a discrete probability distribution that satisfies Zipf’s law: the f...
numpy.reference.random.generated.numpy.random.generator.zipf
numpy.random.geometric random.geometric(p, size=None) Draw samples from the geometric distribution. Bernoulli trials are experiments with one of two outcomes: success or failure (an example of such an experiment is flipping a coin). The geometric distribution models the number of trials that must be run in order to...
numpy.reference.random.generated.numpy.random.geometric
numpy.random.get_state random.get_state() Return a tuple representing the internal state of the generator. For more details, see set_state. Parameters legacybool, optional Flag indicating to return a legacy tuple state when the BitGenerator is MT19937, instead of a dict. Returns out{tuple(str, ndarray o...
numpy.reference.random.generated.numpy.random.get_state
numpy.random.gumbel random.gumbel(loc=0.0, scale=1.0, size=None) Draw samples from a Gumbel distribution. Draw samples from a Gumbel distribution with specified location and scale. For more information on the Gumbel distribution, see Notes and References below. Note New code should use the gumbel method of a defau...
numpy.reference.random.generated.numpy.random.gumbel
numpy.random.hypergeometric random.hypergeometric(ngood, nbad, nsample, size=None) Draw samples from a Hypergeometric distribution. Samples are drawn from a hypergeometric distribution with specified parameters, ngood (ways to make a good selection), nbad (ways to make a bad selection), and nsample (number of items...
numpy.reference.random.generated.numpy.random.hypergeometric
numpy.random.laplace random.laplace(loc=0.0, scale=1.0, size=None) Draw samples from the Laplace or double exponential distribution with specified location (or mean) and scale (decay). The Laplace distribution is similar to the Gaussian/normal distribution, but is sharper at the peak and has fatter tails. It repres...
numpy.reference.random.generated.numpy.random.laplace
numpy.random.logistic random.logistic(loc=0.0, scale=1.0, size=None) Draw samples from a logistic distribution. Samples are drawn from a logistic distribution with specified parameters, loc (location or mean, also median), and scale (>0). Note New code should use the logistic method of a default_rng() instance ins...
numpy.reference.random.generated.numpy.random.logistic
numpy.random.lognormal random.lognormal(mean=0.0, sigma=1.0, size=None) Draw samples from a log-normal distribution. Draw samples from a log-normal distribution with specified mean, standard deviation, and array shape. Note that the mean and standard deviation are not the values for the distribution itself, but of ...
numpy.reference.random.generated.numpy.random.lognormal
numpy.random.logseries random.logseries(p, size=None) Draw samples from a logarithmic series distribution. Samples are drawn from a log series distribution with specified shape parameter, 0 < p < 1. Note New code should use the logseries method of a default_rng() instance instead; please see the Quick Start. Par...
numpy.reference.random.generated.numpy.random.logseries
numpy.random.MT19937.cffi attribute random.MT19937.cffi CFFI interface Returns interfacenamedtuple Named tuple containing CFFI wrapper state_address - Memory address of the state struct state - pointer to the state struct next_uint64 - function pointer to produce 64 bit integers next_uint32 - function pointe...
numpy.reference.random.bit_generators.generated.numpy.random.mt19937.cffi
numpy.random.MT19937.ctypes attribute random.MT19937.ctypes ctypes interface Returns interfacenamedtuple Named tuple containing ctypes wrapper state_address - Memory address of the state struct state - pointer to the state struct next_uint64 - function pointer to produce 64 bit integers next_uint32 - functio...
numpy.reference.random.bit_generators.generated.numpy.random.mt19937.ctypes
numpy.random.MT19937.jumped method random.MT19937.jumped(jumps=1) Returns a new bit generator with the state jumped The state of the returned big generator is jumped as-if 2**(128 * jumps) random numbers have been generated. Parameters jumpsinteger, positive Number of times to jump the state of the bit genera...
numpy.reference.random.bit_generators.generated.numpy.random.mt19937.jumped
numpy.random.MT19937.state attribute random.MT19937.state Get or set the PRNG state Returns statedict Dictionary containing the information required to describe the state of the PRNG
numpy.reference.random.bit_generators.generated.numpy.random.mt19937.state
numpy.random.multinomial random.multinomial(n, pvals, size=None) Draw samples from a multinomial distribution. The multinomial distribution is a multivariate generalization of the binomial distribution. Take an experiment with one of p possible outcomes. An example of such an experiment is throwing a dice, where th...
numpy.reference.random.generated.numpy.random.multinomial
numpy.random.multivariate_normal random.multivariate_normal(mean, cov, size=None, check_valid='warn', tol=1e-8) Draw random samples from a multivariate normal distribution. The multivariate normal, multinormal or Gaussian distribution is a generalization of the one-dimensional normal distribution to higher dimensio...
numpy.reference.random.generated.numpy.random.multivariate_normal
numpy.random.negative_binomial random.negative_binomial(n, p, size=None) Draw samples from a negative binomial distribution. Samples are drawn from a negative binomial distribution with specified parameters, n successes and p probability of success where n is > 0 and p is in the interval [0, 1]. Note New code shou...
numpy.reference.random.generated.numpy.random.negative_binomial
numpy.random.noncentral_chisquare random.noncentral_chisquare(df, nonc, size=None) Draw samples from a noncentral chi-square distribution. The noncentral \(\chi^2\) distribution is a generalization of the \(\chi^2\) distribution. Note New code should use the noncentral_chisquare method of a default_rng() instance ...
numpy.reference.random.generated.numpy.random.noncentral_chisquare
numpy.random.noncentral_f random.noncentral_f(dfnum, dfden, nonc, size=None) Draw samples from the noncentral F distribution. Samples are drawn from an F distribution with specified parameters, dfnum (degrees of freedom in numerator) and dfden (degrees of freedom in denominator), where both parameters > 1. nonc is ...
numpy.reference.random.generated.numpy.random.noncentral_f
numpy.random.normal random.normal(loc=0.0, scale=1.0, size=None) Draw random samples from a normal (Gaussian) distribution. The probability density function of the normal distribution, first derived by De Moivre and 200 years later by both Gauss and Laplace independently [2], is often called the bell curve because ...
numpy.reference.random.generated.numpy.random.normal
numpy.random.pareto random.pareto(a, size=None) Draw samples from a Pareto II or Lomax distribution with specified shape. The Lomax or Pareto II distribution is a shifted Pareto distribution. The classical Pareto distribution can be obtained from the Lomax distribution by adding 1 and multiplying by the scale param...
numpy.reference.random.generated.numpy.random.pareto
numpy.random.PCG64.advance method random.PCG64.advance(delta) Advance the underlying RNG as-if delta draws have occurred. Parameters deltainteger, positive Number of draws to advance the RNG. Must be less than the size state variable in the underlying RNG. Returns selfPCG64 RNG advanced delta steps ...
numpy.reference.random.bit_generators.generated.numpy.random.pcg64.advance
numpy.random.PCG64.cffi attribute random.PCG64.cffi CFFI interface Returns interfacenamedtuple Named tuple containing CFFI wrapper state_address - Memory address of the state struct state - pointer to the state struct next_uint64 - function pointer to produce 64 bit integers next_uint32 - function pointer to...
numpy.reference.random.bit_generators.generated.numpy.random.pcg64.cffi
numpy.random.PCG64.ctypes attribute random.PCG64.ctypes ctypes interface Returns interfacenamedtuple Named tuple containing ctypes wrapper state_address - Memory address of the state struct state - pointer to the state struct next_uint64 - function pointer to produce 64 bit integers next_uint32 - function po...
numpy.reference.random.bit_generators.generated.numpy.random.pcg64.ctypes
numpy.random.PCG64.jumped method random.PCG64.jumped(jumps=1) Returns a new bit generator with the state jumped. Jumps the state as-if jumps * 210306068529402873165736369884012333109 random numbers have been generated. Parameters jumpsinteger, positive Number of times to jump the state of the bit generator re...
numpy.reference.random.bit_generators.generated.numpy.random.pcg64.jumped
numpy.random.PCG64.state attribute random.PCG64.state Get or set the PRNG state Returns statedict Dictionary containing the information required to describe the state of the PRNG
numpy.reference.random.bit_generators.generated.numpy.random.pcg64.state
numpy.random.PCG64DXSM.advance method random.PCG64DXSM.advance(delta) Advance the underlying RNG as-if delta draws have occurred. Parameters deltainteger, positive Number of draws to advance the RNG. Must be less than the size state variable in the underlying RNG. Returns selfPCG64 RNG advanced delta ...
numpy.reference.random.bit_generators.generated.numpy.random.pcg64dxsm.advance
numpy.random.PCG64DXSM.cffi attribute random.PCG64DXSM.cffi CFFI interface Returns interfacenamedtuple Named tuple containing CFFI wrapper state_address - Memory address of the state struct state - pointer to the state struct next_uint64 - function pointer to produce 64 bit integers next_uint32 - function po...
numpy.reference.random.bit_generators.generated.numpy.random.pcg64dxsm.cffi
numpy.random.PCG64DXSM.ctypes attribute random.PCG64DXSM.ctypes ctypes interface Returns interfacenamedtuple Named tuple containing ctypes wrapper state_address - Memory address of the state struct state - pointer to the state struct next_uint64 - function pointer to produce 64 bit integers next_uint32 - fun...
numpy.reference.random.bit_generators.generated.numpy.random.pcg64dxsm.ctypes
numpy.random.PCG64DXSM.jumped method random.PCG64DXSM.jumped(jumps=1) Returns a new bit generator with the state jumped. Jumps the state as-if jumps * 210306068529402873165736369884012333109 random numbers have been generated. Parameters jumpsinteger, positive Number of times to jump the state of the bit gene...
numpy.reference.random.bit_generators.generated.numpy.random.pcg64dxsm.jumped
numpy.random.PCG64DXSM.state attribute random.PCG64DXSM.state Get or set the PRNG state Returns statedict Dictionary containing the information required to describe the state of the PRNG
numpy.reference.random.bit_generators.generated.numpy.random.pcg64dxsm.state
numpy.random.permutation random.permutation(x) Randomly permute a sequence, or return a permuted range. If x is a multi-dimensional array, it is only shuffled along its first index. Note New code should use the permutation method of a default_rng() instance instead; please see the Quick Start. Parameters xint...
numpy.reference.random.generated.numpy.random.permutation
numpy.random.Philox.advance method random.Philox.advance(delta) Advance the underlying RNG as-if delta draws have occurred. Parameters deltainteger, positive Number of draws to advance the RNG. Must be less than the size state variable in the underlying RNG. Returns selfPhilox RNG advanced delta steps...
numpy.reference.random.bit_generators.generated.numpy.random.philox.advance
numpy.random.Philox.cffi attribute random.Philox.cffi CFFI interface Returns interfacenamedtuple Named tuple containing CFFI wrapper state_address - Memory address of the state struct state - pointer to the state struct next_uint64 - function pointer to produce 64 bit integers next_uint32 - function pointer ...
numpy.reference.random.bit_generators.generated.numpy.random.philox.cffi
numpy.random.Philox.ctypes attribute random.Philox.ctypes ctypes interface Returns interfacenamedtuple Named tuple containing ctypes wrapper state_address - Memory address of the state struct state - pointer to the state struct next_uint64 - function pointer to produce 64 bit integers next_uint32 - function ...
numpy.reference.random.bit_generators.generated.numpy.random.philox.ctypes
numpy.random.Philox.jumped method random.Philox.jumped(jumps=1) Returns a new bit generator with the state jumped The state of the returned big generator is jumped as-if 2**(128 * jumps) random numbers have been generated. Parameters jumpsinteger, positive Number of times to jump the state of the bit generato...
numpy.reference.random.bit_generators.generated.numpy.random.philox.jumped
numpy.random.Philox.state attribute random.Philox.state Get or set the PRNG state Returns statedict Dictionary containing the information required to describe the state of the PRNG
numpy.reference.random.bit_generators.generated.numpy.random.philox.state
numpy.random.poisson random.poisson(lam=1.0, size=None) Draw samples from a Poisson distribution. The Poisson distribution is the limit of the binomial distribution for large N. Note New code should use the poisson method of a default_rng() instance instead; please see the Quick Start. Parameters lamfloat or ...
numpy.reference.random.generated.numpy.random.poisson
numpy.random.power random.power(a, size=None) Draws samples in [0, 1] from a power distribution with positive exponent a - 1. Also known as the power function distribution. Note New code should use the power method of a default_rng() instance instead; please see the Quick Start. Parameters afloat or array_lik...
numpy.reference.random.generated.numpy.random.power
numpy.random.rand random.rand(d0, d1, ..., dn) Random values in a given shape. Note This is a convenience function for users porting code from Matlab, and wraps random_sample. That function takes a tuple to specify the size of the output, which is consistent with other NumPy functions like numpy.zeros and numpy.on...
numpy.reference.random.generated.numpy.random.rand
numpy.random.randint random.randint(low, high=None, size=None, dtype=int) Return random integers from low (inclusive) to high (exclusive). Return random integers from the “discrete uniform” distribution of the specified dtype in the “half-open” interval [low, high). If high is None (the default), then results are f...
numpy.reference.random.generated.numpy.random.randint
numpy.random.randn random.randn(d0, d1, ..., dn) Return a sample (or samples) from the “standard normal” distribution. Note This is a convenience function for users porting code from Matlab, and wraps standard_normal. That function takes a tuple to specify the size of the output, which is consistent with other Num...
numpy.reference.random.generated.numpy.random.randn
numpy.random.random random.random(size=None) Return random floats in the half-open interval [0.0, 1.0). Alias for random_sample to ease forward-porting to the new random API.
numpy.reference.random.generated.numpy.random.random
numpy.random.random_integers 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,...
numpy.reference.random.generated.numpy.random.random_integers
numpy.random.random_sample 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 \(Unif[a, b), b > a\) multiply the output of random_sample by (b-a) and add a: (b - a) * random_sample() + ...
numpy.reference.random.generated.numpy.random.random_sample
numpy.random.RandomState.beta method random.RandomState.beta(a, b, size=None) Draw samples from a Beta distribution. The Beta distribution is a special case of the Dirichlet distribution, and is related to the Gamma distribution. It has the probability distribution function \[f(x; a,b) = \frac{1}{B(\alpha, \beta)}...
numpy.reference.random.generated.numpy.random.randomstate.beta
numpy.random.RandomState.binomial method random.RandomState.binomial(n, p, size=None) Draw samples from a binomial distribution. Samples are drawn from a binomial distribution with specified parameters, n trials and p probability of success where n an integer >= 0 and p is in the interval [0,1]. (n may be input as ...
numpy.reference.random.generated.numpy.random.randomstate.binomial
numpy.random.RandomState.bytes method random.RandomState.bytes(length) Return random bytes. Note New code should use the bytes method of a default_rng() instance instead; please see the Quick Start. Parameters lengthint Number of random bytes. Returns outbytes String of length length. See also ...
numpy.reference.random.generated.numpy.random.randomstate.bytes
numpy.random.RandomState.chisquare method random.RandomState.chisquare(df, size=None) Draw samples from a chi-square distribution. When df independent random variables, each with standard normal distributions (mean 0, variance 1), are squared and summed, the resulting distribution is chi-square (see Notes). This di...
numpy.reference.random.generated.numpy.random.randomstate.chisquare
numpy.random.RandomState.choice method random.RandomState.choice(a, size=None, replace=True, p=None) Generates a random sample from a given 1-D array New in version 1.7.0. Note New code should use the choice method of a default_rng() instance instead; please see the Quick Start. Parameters a1-D array-like o...
numpy.reference.random.generated.numpy.random.randomstate.choice
numpy.random.RandomState.dirichlet method random.RandomState.dirichlet(alpha, size=None) Draw samples from the Dirichlet distribution. Draw size samples of dimension k from a Dirichlet distribution. A Dirichlet-distributed random variable can be seen as a multivariate generalization of a Beta distribution. The Diri...
numpy.reference.random.generated.numpy.random.randomstate.dirichlet
numpy.random.RandomState.exponential method random.RandomState.exponential(scale=1.0, size=None) Draw samples from an exponential distribution. Its probability density function is \[f(x; \frac{1}{\beta}) = \frac{1}{\beta} \exp(-\frac{x}{\beta}),\] for x > 0 and 0 elsewhere. \(\beta\) is the scale parameter, which ...
numpy.reference.random.generated.numpy.random.randomstate.exponential
numpy.random.RandomState.f method random.RandomState.f(dfnum, dfden, size=None) Draw samples from an F distribution. Samples are drawn from an F distribution with specified parameters, dfnum (degrees of freedom in numerator) and dfden (degrees of freedom in denominator), where both parameters must be greater than z...
numpy.reference.random.generated.numpy.random.randomstate.f
numpy.random.RandomState.gamma method random.RandomState.gamma(shape, scale=1.0, size=None) Draw samples from a Gamma distribution. Samples are drawn from a Gamma distribution with specified parameters, shape (sometimes designated “k”) and scale (sometimes designated “theta”), where both parameters are > 0. Note N...
numpy.reference.random.generated.numpy.random.randomstate.gamma
numpy.random.RandomState.geometric method random.RandomState.geometric(p, size=None) Draw samples from the geometric distribution. Bernoulli trials are experiments with one of two outcomes: success or failure (an example of such an experiment is flipping a coin). The geometric distribution models the number of tria...
numpy.reference.random.generated.numpy.random.randomstate.geometric
numpy.random.RandomState.get_state method random.RandomState.get_state() Return a tuple representing the internal state of the generator. For more details, see set_state. Parameters legacybool, optional Flag indicating to return a legacy tuple state when the BitGenerator is MT19937, instead of a dict. Retu...
numpy.reference.random.generated.numpy.random.randomstate.get_state
numpy.random.RandomState.gumbel method random.RandomState.gumbel(loc=0.0, scale=1.0, size=None) Draw samples from a Gumbel distribution. Draw samples from a Gumbel distribution with specified location and scale. For more information on the Gumbel distribution, see Notes and References below. Note New code should u...
numpy.reference.random.generated.numpy.random.randomstate.gumbel
numpy.random.RandomState.hypergeometric method random.RandomState.hypergeometric(ngood, nbad, nsample, size=None) Draw samples from a Hypergeometric distribution. Samples are drawn from a hypergeometric distribution with specified parameters, ngood (ways to make a good selection), nbad (ways to make a bad selection...
numpy.reference.random.generated.numpy.random.randomstate.hypergeometric
numpy.random.RandomState.laplace method random.RandomState.laplace(loc=0.0, scale=1.0, size=None) Draw samples from the Laplace or double exponential distribution with specified location (or mean) and scale (decay). The Laplace distribution is similar to the Gaussian/normal distribution, but is sharper at the peak ...
numpy.reference.random.generated.numpy.random.randomstate.laplace
numpy.random.RandomState.logistic method random.RandomState.logistic(loc=0.0, scale=1.0, size=None) Draw samples from a logistic distribution. Samples are drawn from a logistic distribution with specified parameters, loc (location or mean, also median), and scale (>0). Note New code should use the logistic method ...
numpy.reference.random.generated.numpy.random.randomstate.logistic
numpy.random.RandomState.lognormal method random.RandomState.lognormal(mean=0.0, sigma=1.0, size=None) Draw samples from a log-normal distribution. Draw samples from a log-normal distribution with specified mean, standard deviation, and array shape. Note that the mean and standard deviation are not the values for t...
numpy.reference.random.generated.numpy.random.randomstate.lognormal
numpy.random.RandomState.logseries method random.RandomState.logseries(p, size=None) Draw samples from a logarithmic series distribution. Samples are drawn from a log series distribution with specified shape parameter, 0 < p < 1. Note New code should use the logseries method of a default_rng() instance instead; pl...
numpy.reference.random.generated.numpy.random.randomstate.logseries
numpy.random.RandomState.multinomial method random.RandomState.multinomial(n, pvals, size=None) Draw samples from a multinomial distribution. The multinomial distribution is a multivariate generalization of the binomial distribution. Take an experiment with one of p possible outcomes. An example of such an experime...
numpy.reference.random.generated.numpy.random.randomstate.multinomial
numpy.random.RandomState.multivariate_normal method random.RandomState.multivariate_normal(mean, cov, size=None, check_valid='warn', tol=1e-8) Draw random samples from a multivariate normal distribution. The multivariate normal, multinormal or Gaussian distribution is a generalization of the one-dimensional normal ...
numpy.reference.random.generated.numpy.random.randomstate.multivariate_normal
numpy.random.RandomState.negative_binomial method random.RandomState.negative_binomial(n, p, size=None) Draw samples from a negative binomial distribution. Samples are drawn from a negative binomial distribution with specified parameters, n successes and p probability of success where n is > 0 and p is in the inter...
numpy.reference.random.generated.numpy.random.randomstate.negative_binomial
numpy.random.RandomState.noncentral_chisquare method random.RandomState.noncentral_chisquare(df, nonc, size=None) Draw samples from a noncentral chi-square distribution. The noncentral \(\chi^2\) distribution is a generalization of the \(\chi^2\) distribution. Note New code should use the noncentral_chisquare meth...
numpy.reference.random.generated.numpy.random.randomstate.noncentral_chisquare
numpy.random.RandomState.noncentral_f method random.RandomState.noncentral_f(dfnum, dfden, nonc, size=None) Draw samples from the noncentral F distribution. Samples are drawn from an F distribution with specified parameters, dfnum (degrees of freedom in numerator) and dfden (degrees of freedom in denominator), wher...
numpy.reference.random.generated.numpy.random.randomstate.noncentral_f
numpy.random.RandomState.normal method random.RandomState.normal(loc=0.0, scale=1.0, size=None) Draw random samples from a normal (Gaussian) distribution. The probability density function of the normal distribution, first derived by De Moivre and 200 years later by both Gauss and Laplace independently [2], is often...
numpy.reference.random.generated.numpy.random.randomstate.normal
numpy.random.RandomState.pareto method random.RandomState.pareto(a, size=None) Draw samples from a Pareto II or Lomax distribution with specified shape. The Lomax or Pareto II distribution is a shifted Pareto distribution. The classical Pareto distribution can be obtained from the Lomax distribution by adding 1 and...
numpy.reference.random.generated.numpy.random.randomstate.pareto
numpy.random.RandomState.permutation method random.RandomState.permutation(x) Randomly permute a sequence, or return a permuted range. If x is a multi-dimensional array, it is only shuffled along its first index. Note New code should use the permutation method of a default_rng() instance instead; please see the Qu...
numpy.reference.random.generated.numpy.random.randomstate.permutation
numpy.random.RandomState.poisson method random.RandomState.poisson(lam=1.0, size=None) Draw samples from a Poisson distribution. The Poisson distribution is the limit of the binomial distribution for large N. Note New code should use the poisson method of a default_rng() instance instead; please see the Quick Star...
numpy.reference.random.generated.numpy.random.randomstate.poisson
numpy.random.RandomState.power method random.RandomState.power(a, size=None) Draws samples in [0, 1] from a power distribution with positive exponent a - 1. Also known as the power function distribution. Note New code should use the power method of a default_rng() instance instead; please see the Quick Start. Pa...
numpy.reference.random.generated.numpy.random.randomstate.power
numpy.random.RandomState.rand method random.RandomState.rand(d0, d1, ..., dn) Random values in a given shape. Note This is a convenience function for users porting code from Matlab, and wraps random_sample. That function takes a tuple to specify the size of the output, which is consistent with other NumPy function...
numpy.reference.random.generated.numpy.random.randomstate.rand
numpy.random.RandomState.randint method random.RandomState.randint(low, high=None, size=None, dtype=int) Return random integers from low (inclusive) to high (exclusive). Return random integers from the “discrete uniform” distribution of the specified dtype in the “half-open” interval [low, high). If high is None (t...
numpy.reference.random.generated.numpy.random.randomstate.randint
numpy.random.RandomState.randn method random.RandomState.randn(d0, d1, ..., dn) Return a sample (or samples) from the “standard normal” distribution. Note This is a convenience function for users porting code from Matlab, and wraps standard_normal. That function takes a tuple to specify the size of the output, whi...
numpy.reference.random.generated.numpy.random.randomstate.randn
numpy.random.RandomState.random_integers method random.RandomState.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 defa...
numpy.reference.random.generated.numpy.random.randomstate.random_integers
numpy.random.RandomState.random_sample method random.RandomState.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 \(Unif[a, b), b > a\) multiply the output of random_sample by (b-a) and add ...
numpy.reference.random.generated.numpy.random.randomstate.random_sample
numpy.random.RandomState.rayleigh method random.RandomState.rayleigh(scale=1.0, size=None) Draw samples from a Rayleigh distribution. The \(\chi\) and Weibull distributions are generalizations of the Rayleigh. Note New code should use the rayleigh method of a default_rng() instance instead; please see the Quick St...
numpy.reference.random.generated.numpy.random.randomstate.rayleigh
numpy.random.RandomState.seed method random.RandomState.seed(self, seed=None) Reseed a legacy MT19937 BitGenerator Notes This is a convenience, legacy function. The best practice is to not reseed a BitGenerator, rather to recreate a new one. This method is here for legacy reasons. This example demonstrates best pra...
numpy.reference.random.generated.numpy.random.randomstate.seed
numpy.random.RandomState.set_state method random.RandomState.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 bit generator used by the RandomState instance. By default, RandomState uses the “Mersenne Twister”[1] pseudo-r...
numpy.reference.random.generated.numpy.random.randomstate.set_state
numpy.random.RandomState.shuffle method random.RandomState.shuffle(x) Modify a sequence in-place by shuffling its contents. This function only shuffles the array along the first axis of a multi-dimensional array. The order of sub-arrays is changed but their contents remains the same. Note New code should use the s...
numpy.reference.random.generated.numpy.random.randomstate.shuffle
numpy.random.RandomState.standard_cauchy method random.RandomState.standard_cauchy(size=None) Draw samples from a standard Cauchy distribution with mode = 0. Also known as the Lorentz distribution. Note New code should use the standard_cauchy method of a default_rng() instance instead; please see the Quick Start. ...
numpy.reference.random.generated.numpy.random.randomstate.standard_cauchy
numpy.random.RandomState.standard_exponential method random.RandomState.standard_exponential(size=None) Draw samples from the standard exponential distribution. standard_exponential is identical to the exponential distribution with a scale parameter of 1. Note New code should use the standard_exponential method of...
numpy.reference.random.generated.numpy.random.randomstate.standard_exponential
numpy.random.RandomState.standard_gamma method random.RandomState.standard_gamma(shape, size=None) Draw samples from a standard Gamma distribution. Samples are drawn from a Gamma distribution with specified parameters, shape (sometimes designated “k”) and scale=1. Note New code should use the standard_gamma method...
numpy.reference.random.generated.numpy.random.randomstate.standard_gamma
numpy.random.RandomState.standard_normal method random.RandomState.standard_normal(size=None) Draw samples from a standard Normal distribution (mean=0, stdev=1). Note New code should use the standard_normal method of a default_rng() instance instead; please see the Quick Start. Parameters sizeint or tuple of ...
numpy.reference.random.generated.numpy.random.randomstate.standard_normal
numpy.random.RandomState.standard_t method random.RandomState.standard_t(df, size=None) Draw samples from a standard Student’s t distribution with df degrees of freedom. A special case of the hyperbolic distribution. As df gets large, the result resembles that of the standard normal distribution (standard_normal). ...
numpy.reference.random.generated.numpy.random.randomstate.standard_t