doc_content stringlengths 1 386k | doc_id stringlengths 5 188 |
|---|---|
numpy.polynomial.legendre.legx polynomial.legendre.legx = array([0, 1])
An array object represents a multidimensional, homogeneous array of fixed-size items. An associated data-type object describes the format of each element in the array (its byte-order, how many bytes it occupies in memory, whether it is an integ... | numpy.reference.generated.numpy.polynomial.legendre.legx |
numpy.polynomial.legendre.legzero polynomial.legendre.legzero = array([0])
An array object represents a multidimensional, homogeneous array of fixed-size items. An associated data-type object describes the format of each element in the array (its byte-order, how many bytes it occupies in memory, whether it is an in... | numpy.reference.generated.numpy.polynomial.legendre.legzero |
numpy.polynomial.legendre.poly2leg polynomial.legendre.poly2leg(pol)[source]
Convert a polynomial to a Legendre series. Convert an array representing the coefficients of a polynomial (relative to the “standard” basis) ordered from lowest degree to highest, to an array of the coefficients of the equivalent Legendre ... | numpy.reference.generated.numpy.polynomial.legendre.poly2leg |
numpy.polynomial.polynomial.polyadd polynomial.polynomial.polyadd(c1, c2)[source]
Add one polynomial to another. Returns the sum of two polynomials c1 + c2. The arguments are sequences of coefficients from lowest order term to highest, i.e., [1,2,3] represents the polynomial 1 + 2*x + 3*x**2. Parameters
c1, c2a... | numpy.reference.generated.numpy.polynomial.polynomial.polyadd |
numpy.polynomial.polynomial.polycompanion polynomial.polynomial.polycompanion(c)[source]
Return the companion matrix of c. The companion matrix for power series cannot be made symmetric by scaling the basis, so this function differs from those for the orthogonal polynomials. Parameters
carray_like
1-D array o... | numpy.reference.generated.numpy.polynomial.polynomial.polycompanion |
numpy.polynomial.polynomial.polyder polynomial.polynomial.polyder(c, m=1, scl=1, axis=0)[source]
Differentiate a polynomial. Returns the polynomial coefficients c differentiated m times along axis. At each iteration the result is multiplied by scl (the scaling factor is for use in a linear change of variable). The ... | numpy.reference.generated.numpy.polynomial.polynomial.polyder |
numpy.polynomial.polynomial.polydiv polynomial.polynomial.polydiv(c1, c2)[source]
Divide one polynomial by another. Returns the quotient-with-remainder of two polynomials c1 / c2. The arguments are sequences of coefficients, from lowest order term to highest, e.g., [1,2,3] represents 1 + 2*x + 3*x**2. Parameters
... | numpy.reference.generated.numpy.polynomial.polynomial.polydiv |
numpy.polynomial.polynomial.polydomain polynomial.polynomial.polydomain = array([-1, 1])
An array object represents a multidimensional, homogeneous array of fixed-size items. An associated data-type object describes the format of each element in the array (its byte-order, how many bytes it occupies in memory, wheth... | numpy.reference.generated.numpy.polynomial.polynomial.polydomain |
numpy.polynomial.polynomial.polyfit polynomial.polynomial.polyfit(x, y, deg, rcond=None, full=False, w=None)[source]
Least-squares fit of a polynomial to data. Return the coefficients of a polynomial of degree deg that is the least squares fit to the data values y given at points x. If y is 1-D the returned coeffic... | numpy.reference.generated.numpy.polynomial.polynomial.polyfit |
numpy.polynomial.polynomial.polyfromroots polynomial.polynomial.polyfromroots(roots)[source]
Generate a monic polynomial with given roots. Return the coefficients of the polynomial \[p(x) = (x - r_0) * (x - r_1) * ... * (x - r_n),\] where the r_n are the roots specified in roots. If a zero has multiplicity n, then... | numpy.reference.generated.numpy.polynomial.polynomial.polyfromroots |
numpy.polynomial.polynomial.polygrid2d polynomial.polynomial.polygrid2d(x, y, c)[source]
Evaluate a 2-D polynomial on the Cartesian product of x and y. This function returns the values: \[p(a,b) = \sum_{i,j} c_{i,j} * a^i * b^j\] where the points (a, b) consist of all pairs formed by taking a from x and b from y. ... | numpy.reference.generated.numpy.polynomial.polynomial.polygrid2d |
numpy.polynomial.polynomial.polygrid3d polynomial.polynomial.polygrid3d(x, y, z, c)[source]
Evaluate a 3-D polynomial on the Cartesian product of x, y and z. This function returns the values: \[p(a,b,c) = \sum_{i,j,k} c_{i,j,k} * a^i * b^j * c^k\] where the points (a, b, c) consist of all triples formed by taking ... | numpy.reference.generated.numpy.polynomial.polynomial.polygrid3d |
numpy.polynomial.polynomial.polyint polynomial.polynomial.polyint(c, m=1, k=[], lbnd=0, scl=1, axis=0)[source]
Integrate a polynomial. Returns the polynomial coefficients c integrated m times from lbnd along axis. At each iteration the resulting series is multiplied by scl and an integration constant, k, is added. ... | numpy.reference.generated.numpy.polynomial.polynomial.polyint |
numpy.polynomial.polynomial.polyline polynomial.polynomial.polyline(off, scl)[source]
Returns an array representing a linear polynomial. Parameters
off, sclscalars
The “y-intercept” and “slope” of the line, respectively. Returns
yndarray
This module’s representation of the linear polynomial off +
scl*... | numpy.reference.generated.numpy.polynomial.polynomial.polyline |
numpy.polynomial.polynomial.polymul polynomial.polynomial.polymul(c1, c2)[source]
Multiply one polynomial by another. Returns the product of two polynomials c1 * c2. The arguments are sequences of coefficients, from lowest order term to highest, e.g., [1,2,3] represents the polynomial 1 + 2*x + 3*x**2. Parameters ... | numpy.reference.generated.numpy.polynomial.polynomial.polymul |
numpy.polynomial.polynomial.polymulx polynomial.polynomial.polymulx(c)[source]
Multiply a polynomial by x. Multiply the polynomial c by x, where x is the independent variable. Parameters
carray_like
1-D array of polynomial coefficients ordered from low to high. Returns
outndarray
Array representing th... | numpy.reference.generated.numpy.polynomial.polynomial.polymulx |
numpy.polynomial.polynomial.Polynomial.__call__ method polynomial.polynomial.Polynomial.__call__(arg)[source]
Call self as a function. | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.__call__ |
numpy.polynomial.polynomial.Polynomial.basis method classmethod polynomial.polynomial.Polynomial.basis(deg, domain=None, window=None)[source]
Series basis polynomial of degree deg. Returns the series representing the basis polynomial of degree deg. New in version 1.7.0. Parameters
degint
Degree of the basis... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.basis |
numpy.polynomial.polynomial.Polynomial.cast method classmethod polynomial.polynomial.Polynomial.cast(series, domain=None, window=None)[source]
Convert series to series of this class. The series is expected to be an instance of some polynomial series of one of the types supported by by the numpy.polynomial module, b... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.cast |
numpy.polynomial.polynomial.Polynomial.convert method polynomial.polynomial.Polynomial.convert(domain=None, kind=None, window=None)[source]
Convert series to a different kind and/or domain and/or window. Parameters
domainarray_like, optional
The domain of the converted series. If the value is None, the defaul... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.convert |
numpy.polynomial.polynomial.Polynomial.copy method polynomial.polynomial.Polynomial.copy()[source]
Return a copy. Returns
new_seriesseries
Copy of self. | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.copy |
numpy.polynomial.polynomial.Polynomial.cutdeg method polynomial.polynomial.Polynomial.cutdeg(deg)[source]
Truncate series to the given degree. Reduce the degree of the series to deg by discarding the high order terms. If deg is greater than the current degree a copy of the current series is returned. This can be us... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.cutdeg |
numpy.polynomial.polynomial.Polynomial.degree method polynomial.polynomial.Polynomial.degree()[source]
The degree of the series. New in version 1.5.0. Returns
degreeint
Degree of the series, one less than the number of coefficients. | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.degree |
numpy.polynomial.polynomial.Polynomial.deriv method polynomial.polynomial.Polynomial.deriv(m=1)[source]
Differentiate. Return a series instance of that is the derivative of the current series. Parameters
mnon-negative int
Find the derivative of order m. Returns
new_seriesseries
A new series representi... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.deriv |
numpy.polynomial.polynomial.Polynomial.domain attribute polynomial.polynomial.Polynomial.domain = array([-1, 1]) | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.domain |
numpy.polynomial.polynomial.Polynomial.fit method classmethod polynomial.polynomial.Polynomial.fit(x, y, deg, domain=None, rcond=None, full=False, w=None, window=None)[source]
Least squares fit to data. Return a series instance that is the least squares fit to the data y sampled at x. The domain of the returned ins... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.fit |
numpy.polynomial.polynomial.Polynomial.fromroots method classmethod polynomial.polynomial.Polynomial.fromroots(roots, domain=[], window=None)[source]
Return series instance that has the specified roots. Returns a series representing the product (x - r[0])*(x - r[1])*...*(x - r[n-1]), where r is a list of roots. Pa... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.fromroots |
numpy.polynomial.polynomial.Polynomial.has_samecoef method polynomial.polynomial.Polynomial.has_samecoef(other)[source]
Check if coefficients match. New in version 1.6.0. Parameters
otherclass instance
The other class must have the coef attribute. Returns
boolboolean
True if the coefficients are the... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.has_samecoef |
numpy.polynomial.polynomial.Polynomial.has_samedomain method polynomial.polynomial.Polynomial.has_samedomain(other)[source]
Check if domains match. New in version 1.6.0. Parameters
otherclass instance
The other class must have the domain attribute. Returns
boolboolean
True if the domains are the sam... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.has_samedomain |
numpy.polynomial.polynomial.Polynomial.has_sametype method polynomial.polynomial.Polynomial.has_sametype(other)[source]
Check if types match. New in version 1.7.0. Parameters
otherobject
Class instance. Returns
boolboolean
True if other is same class as self | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.has_sametype |
numpy.polynomial.polynomial.Polynomial.has_samewindow method polynomial.polynomial.Polynomial.has_samewindow(other)[source]
Check if windows match. New in version 1.6.0. Parameters
otherclass instance
The other class must have the window attribute. Returns
boolboolean
True if the windows are the sam... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.has_samewindow |
numpy.polynomial.polynomial.Polynomial.identity method classmethod polynomial.polynomial.Polynomial.identity(domain=None, window=None)[source]
Identity function. If p is the returned series, then p(x) == x for all values of x. Parameters
domain{None, array_like}, optional
If given, the array must be of the fo... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.identity |
numpy.polynomial.polynomial.Polynomial.integ method polynomial.polynomial.Polynomial.integ(m=1, k=[], lbnd=None)[source]
Integrate. Return a series instance that is the definite integral of the current series. Parameters
mnon-negative int
The number of integrations to perform.
karray_like
Integration cons... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.integ |
numpy.polynomial.polynomial.Polynomial.linspace method polynomial.polynomial.Polynomial.linspace(n=100, domain=None)[source]
Return x, y values at equally spaced points in domain. Returns the x, y values at n linearly spaced points across the domain. Here y is the value of the polynomial at the points x. By default... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.linspace |
numpy.polynomial.polynomial.Polynomial.mapparms method polynomial.polynomial.Polynomial.mapparms()[source]
Return the mapping parameters. The returned values define a linear map off + scl*x that is applied to the input arguments before the series is evaluated. The map depends on the domain and window; if the curren... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.mapparms |
numpy.polynomial.polynomial.Polynomial.roots method polynomial.polynomial.Polynomial.roots()[source]
Return the roots of the series polynomial. Compute the roots for the series. Note that the accuracy of the roots decrease the further outside the domain they lie. Returns
rootsndarray
Array containing the root... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.roots |
numpy.polynomial.polynomial.Polynomial.trim method polynomial.polynomial.Polynomial.trim(tol=0)[source]
Remove trailing coefficients Remove trailing coefficients until a coefficient is reached whose absolute value greater than tol or the beginning of the series is reached. If all the coefficients would be removed t... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.trim |
numpy.polynomial.polynomial.Polynomial.truncate method polynomial.polynomial.Polynomial.truncate(size)[source]
Truncate series to length size. Reduce the series to length size by discarding the high degree terms. The value of size must be a positive integer. This can be useful in least squares where the coefficient... | numpy.reference.generated.numpy.polynomial.polynomial.polynomial.truncate |
numpy.polynomial.polynomial.polyone polynomial.polynomial.polyone = array([1])
An array object represents a multidimensional, homogeneous array of fixed-size items. An associated data-type object describes the format of each element in the array (its byte-order, how many bytes it occupies in memory, whether it is a... | numpy.reference.generated.numpy.polynomial.polynomial.polyone |
numpy.polynomial.polynomial.polypow polynomial.polynomial.polypow(c, pow, maxpower=None)[source]
Raise a polynomial to a power. Returns the polynomial c raised to the power pow. The argument c is a sequence of coefficients ordered from low to high. i.e., [1,2,3] is the series 1 + 2*x + 3*x**2. Parameters
carray... | numpy.reference.generated.numpy.polynomial.polynomial.polypow |
numpy.polynomial.polynomial.polyroots polynomial.polynomial.polyroots(c)[source]
Compute the roots of a polynomial. Return the roots (a.k.a. “zeros”) of the polynomial \[p(x) = \sum_i c[i] * x^i.\] Parameters
c1-D array_like
1-D array of polynomial coefficients. Returns
outndarray
Array of the roots ... | numpy.reference.generated.numpy.polynomial.polynomial.polyroots |
numpy.polynomial.polynomial.polysub polynomial.polynomial.polysub(c1, c2)[source]
Subtract one polynomial from another. Returns the difference of two polynomials c1 - c2. The arguments are sequences of coefficients from lowest order term to highest, i.e., [1,2,3] represents the polynomial 1 + 2*x + 3*x**2. Paramet... | numpy.reference.generated.numpy.polynomial.polynomial.polysub |
numpy.polynomial.polynomial.polytrim polynomial.polynomial.polytrim(c, tol=0)[source]
Remove “small” “trailing” coefficients from a polynomial. “Small” means “small in absolute value” and is controlled by the parameter tol; “trailing” means highest order coefficient(s), e.g., in [0, 1, 1, 0, 0] (which represents 0 ... | numpy.reference.generated.numpy.polynomial.polynomial.polytrim |
numpy.polynomial.polynomial.polyval polynomial.polynomial.polyval(x, c, tensor=True)[source]
Evaluate a polynomial at points x. If c is of length n + 1, this function returns the value \[p(x) = c_0 + c_1 * x + ... + c_n * x^n\] The parameter x is converted to an array only if it is a tuple or a list, otherwise it ... | numpy.reference.generated.numpy.polynomial.polynomial.polyval |
numpy.polynomial.polynomial.polyval2d polynomial.polynomial.polyval2d(x, y, c)[source]
Evaluate a 2-D polynomial at points (x, y). This function returns the value \[p(x,y) = \sum_{i,j} c_{i,j} * x^i * y^j\] The parameters x and y are converted to arrays only if they are tuples or a lists, otherwise they are treate... | numpy.reference.generated.numpy.polynomial.polynomial.polyval2d |
numpy.polynomial.polynomial.polyval3d polynomial.polynomial.polyval3d(x, y, z, c)[source]
Evaluate a 3-D polynomial at points (x, y, z). This function returns the values: \[p(x,y,z) = \sum_{i,j,k} c_{i,j,k} * x^i * y^j * z^k\] The parameters x, y, and z are converted to arrays only if they are tuples or a lists, o... | numpy.reference.generated.numpy.polynomial.polynomial.polyval3d |
numpy.polynomial.polynomial.polyvalfromroots polynomial.polynomial.polyvalfromroots(x, r, tensor=True)[source]
Evaluate a polynomial specified by its roots at points x. If r is of length N, this function returns the value \[p(x) = \prod_{n=1}^{N} (x - r_n)\] The parameter x is converted to an array only if it is a... | numpy.reference.generated.numpy.polynomial.polynomial.polyvalfromroots |
numpy.polynomial.polynomial.polyvander polynomial.polynomial.polyvander(x, deg)[source]
Vandermonde matrix of given degree. Returns the Vandermonde matrix of degree deg and sample points x. The Vandermonde matrix is defined by \[V[..., i] = x^i,\] where 0 <= i <= deg. The leading indices of V index the elements of... | numpy.reference.generated.numpy.polynomial.polynomial.polyvander |
numpy.polynomial.polynomial.polyvander2d polynomial.polynomial.polyvander2d(x, y, deg)[source]
Pseudo-Vandermonde matrix of given degrees. Returns the pseudo-Vandermonde matrix of degrees deg and sample points (x, y). The pseudo-Vandermonde matrix is defined by \[V[..., (deg[1] + 1)*i + j] = x^i * y^j,\] where 0 <... | numpy.reference.generated.numpy.polynomial.polynomial.polyvander2d |
numpy.polynomial.polynomial.polyvander3d polynomial.polynomial.polyvander3d(x, y, z, deg)[source]
Pseudo-Vandermonde matrix of given degrees. Returns the pseudo-Vandermonde matrix of degrees deg and sample points (x, y, z). If l, m, n are the given degrees in x, y, z, then The pseudo-Vandermonde matrix is defined b... | numpy.reference.generated.numpy.polynomial.polynomial.polyvander3d |
numpy.polynomial.polynomial.polyx polynomial.polynomial.polyx = array([0, 1])
An array object represents a multidimensional, homogeneous array of fixed-size items. An associated data-type object describes the format of each element in the array (its byte-order, how many bytes it occupies in memory, whether it is an... | numpy.reference.generated.numpy.polynomial.polynomial.polyx |
numpy.polynomial.polynomial.polyzero polynomial.polynomial.polyzero = array([0])
An array object represents a multidimensional, homogeneous array of fixed-size items. An associated data-type object describes the format of each element in the array (its byte-order, how many bytes it occupies in memory, whether it is... | numpy.reference.generated.numpy.polynomial.polynomial.polyzero |
numpy.polynomial.polyutils.as_series polynomial.polyutils.as_series(alist, trim=True)[source]
Return argument as a list of 1-d arrays. The returned list contains array(s) of dtype double, complex double, or object. A 1-d argument of shape (N,) is parsed into N arrays of size one; a 2-d argument of shape (M,N) is pa... | numpy.reference.generated.numpy.polynomial.polyutils.as_series |
numpy.polynomial.polyutils.getdomain polynomial.polyutils.getdomain(x)[source]
Return a domain suitable for given abscissae. Find a domain suitable for a polynomial or Chebyshev series defined at the values supplied. Parameters
xarray_like
1-d array of abscissae whose domain will be determined. Returns
... | numpy.reference.generated.numpy.polynomial.polyutils.getdomain |
numpy.polynomial.polyutils.mapdomain polynomial.polyutils.mapdomain(x, old, new)[source]
Apply linear map to input points. The linear map offset + scale*x that maps the domain old to the domain new is applied to the points x. Parameters
xarray_like
Points to be mapped. If x is a subtype of ndarray the subtype... | numpy.reference.generated.numpy.polynomial.polyutils.mapdomain |
numpy.polynomial.polyutils.mapparms polynomial.polyutils.mapparms(old, new)[source]
Linear map parameters between domains. Return the parameters of the linear map offset + scale*x that maps old to new such that old[i] -> new[i], i = 0, 1. Parameters
old, newarray_like
Domains. Each domain must (successfully) ... | numpy.reference.generated.numpy.polynomial.polyutils.mapparms |
numpy.polynomial.polyutils.RankWarning exception polynomial.polyutils.RankWarning[source]
Issued by chebfit when the design matrix is rank deficient. | numpy.reference.generated.numpy.polynomial.polyutils.rankwarning |
numpy.polynomial.polyutils.trimcoef polynomial.polyutils.trimcoef(c, tol=0)[source]
Remove “small” “trailing” coefficients from a polynomial. “Small” means “small in absolute value” and is controlled by the parameter tol; “trailing” means highest order coefficient(s), e.g., in [0, 1, 1, 0, 0] (which represents 0 + ... | numpy.reference.generated.numpy.polynomial.polyutils.trimcoef |
numpy.polynomial.polyutils.trimseq polynomial.polyutils.trimseq(seq)[source]
Remove small Poly series coefficients. Parameters
seqsequence
Sequence of Poly series coefficients. This routine fails for empty sequences. Returns
seriessequence
Subsequence with trailing zeros removed. If the resulting sequ... | numpy.reference.generated.numpy.polynomial.polyutils.trimseq |
numpy.polynomial.set_default_printstyle polynomial.set_default_printstyle(style)[source]
Set the default format for the string representation of polynomials. Values for style must be valid inputs to __format__, i.e. ‘ascii’ or ‘unicode’. Parameters
stylestr
Format string for default printing style. Must be ei... | numpy.reference.generated.numpy.polynomial.set_default_printstyle |
Polyutils Utility classes and functions for the polynomial modules. This module provides: error and warning objects; a polynomial base class; and some routines used in both the polynomial and chebyshev modules. Warning objects
RankWarning Issued by chebfit when the design matrix is rank deficient. Functions
as... | numpy.reference.routines.polynomials.polyutils |
numpy.random.beta random.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)} x^{\alpha - 1} (1 - x)^{\beta ... | numpy.reference.random.generated.numpy.random.beta |
numpy.random.binomial random.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 a float, but it is truncated to... | numpy.reference.random.generated.numpy.random.binomial |
numpy.random.BitGenerator.cffi attribute random.BitGenerator.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 - funct... | numpy.reference.random.bit_generators.generated.numpy.random.bitgenerator.cffi |
numpy.random.BitGenerator.random_raw method random.BitGenerator.random_raw(self, size=None)
Return randoms as generated by the underlying BitGenerator Parameters
sizeint 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... | numpy.reference.random.bit_generators.generated.numpy.random.bitgenerator.random_raw |
numpy.random.bytes random.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 Generator.bytes
which should ... | numpy.reference.random.generated.numpy.random.bytes |
numpy.random.chisquare random.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 distribution is often used in hyp... | numpy.reference.random.generated.numpy.random.chisquare |
numpy.random.choice random.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 or int
If an ndarray, a random... | numpy.reference.random.generated.numpy.random.choice |
numpy.random.dirichlet random.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 Dirichlet distribution is a conjuga... | numpy.reference.random.generated.numpy.random.dirichlet |
numpy.random.exponential random.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 is the inverse of the rate para... | numpy.reference.random.generated.numpy.random.exponential |
numpy.random.f random.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 zero. The random variate of the ... | numpy.reference.random.generated.numpy.random.f |
numpy.random.gamma random.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 New code should use the gamma me... | numpy.reference.random.generated.numpy.random.gamma |
numpy.random.Generator.beta method random.Generator.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)} x^{... | numpy.reference.random.generated.numpy.random.generator.beta |
numpy.random.Generator.binomial method random.Generator.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 a fl... | numpy.reference.random.generated.numpy.random.generator.binomial |
numpy.random.Generator.bit_generator attribute random.Generator.bit_generator
Gets the bit generator instance used by the generator Returns
bit_generatorBitGenerator
The bit generator instance used by the generator | numpy.reference.random.generated.numpy.random.generator.bit_generator |
numpy.random.Generator.bytes method random.Generator.bytes(length)
Return random bytes. Parameters
lengthint
Number of random bytes. Returns
outbytes
String of length length. Examples >>> np.random.default_rng().bytes(10)
b'\xfeC\x9b\x86\x17\xf2\xa1\xafcp' # random | numpy.reference.random.generated.numpy.random.generator.bytes |
numpy.random.Generator.chisquare method random.Generator.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 distri... | numpy.reference.random.generated.numpy.random.generator.chisquare |
numpy.random.Generator.choice method random.Generator.choice(a, size=None, replace=True, p=None, axis=0, shuffle=True)
Generates a random sample from a given array Parameters
a{array_like, int}
If an ndarray, a random sample is generated from its elements. If an int, the random sample is generated from np.ara... | numpy.reference.random.generated.numpy.random.generator.choice |
numpy.random.Generator.dirichlet method random.Generator.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 Dirichle... | numpy.reference.random.generated.numpy.random.generator.dirichlet |
numpy.random.Generator.exponential method random.Generator.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 is t... | numpy.reference.random.generated.numpy.random.generator.exponential |
numpy.random.Generator.f method random.Generator.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 zero.... | numpy.reference.random.generated.numpy.random.generator.f |
numpy.random.Generator.gamma method random.Generator.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. Parameters... | numpy.reference.random.generated.numpy.random.generator.gamma |
numpy.random.Generator.geometric method random.Generator.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 t... | numpy.reference.random.generated.numpy.random.generator.geometric |
numpy.random.Generator.gumbel method random.Generator.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. Parameters
locfloat or ... | numpy.reference.random.generated.numpy.random.generator.gumbel |
numpy.random.Generator.hypergeometric method random.Generator.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), a... | numpy.reference.random.generated.numpy.random.generator.hypergeometric |
numpy.random.Generator.integers method random.Generator.integers(low, high=None, size=None, dtype=np.int64, endpoint=False)
Return random integers from low (inclusive) to high (exclusive), or if endpoint=True, low (inclusive) to high (inclusive). Replaces RandomState.randint (with endpoint=False) and RandomState.ra... | numpy.reference.random.generated.numpy.random.generator.integers |
numpy.random.Generator.laplace method random.Generator.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 ... | numpy.reference.random.generated.numpy.random.generator.laplace |
numpy.random.Generator.logistic method random.Generator.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). Parameters
locfloat or array_like of floats, o... | numpy.reference.random.generated.numpy.random.generator.logistic |
numpy.random.Generator.lognormal method random.Generator.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 d... | numpy.reference.random.generated.numpy.random.generator.lognormal |
numpy.random.Generator.logseries method random.Generator.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. Parameters
pfloat or array_like of floats
Shape parameter for the distribution. Must... | numpy.reference.random.generated.numpy.random.generator.logseries |
numpy.random.Generator.multinomial method random.Generator.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 i... | numpy.reference.random.generated.numpy.random.generator.multinomial |
numpy.random.Generator.multivariate_hypergeometric method random.Generator.multivariate_hypergeometric(colors, nsample, size=None, method='marginals')
Generate variates from a multivariate hypergeometric distribution. The multivariate hypergeometric distribution is a generalization of the hypergeometric distributio... | numpy.reference.random.generated.numpy.random.generator.multivariate_hypergeometric |
numpy.random.Generator.multivariate_normal method random.Generator.multivariate_normal(mean, cov, size=None, check_valid='warn', tol=1e-8, *, method='svd')
Draw random samples from a multivariate normal distribution. The multivariate normal, multinormal or Gaussian distribution is a generalization of the one-dimens... | numpy.reference.random.generated.numpy.random.generator.multivariate_normal |
numpy.random.Generator.negative_binomial method random.Generator.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 ... | numpy.reference.random.generated.numpy.random.generator.negative_binomial |
numpy.random.Generator.noncentral_chisquare method random.Generator.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. Parameters
dffloat or array_like of floats
Degrees of... | numpy.reference.random.generated.numpy.random.generator.noncentral_chisquare |
numpy.random.Generator.noncentral_f method random.Generator.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 bo... | numpy.reference.random.generated.numpy.random.generator.noncentral_f |
numpy.random.Generator.normal method random.Generator.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 cal... | numpy.reference.random.generated.numpy.random.generator.normal |
numpy.random.Generator.pareto method random.Generator.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 mul... | numpy.reference.random.generated.numpy.random.generator.pareto |
numpy.random.Generator.permutation method random.Generator.permutation(x, axis=0)
Randomly permute a sequence, or return a permuted range. Parameters
xint or array_like
If x is an integer, randomly permute np.arange(x). If x is an array, make a copy and shuffle the elements randomly.
axisint, optional
The... | numpy.reference.random.generated.numpy.random.generator.permutation |
numpy.random.Generator.permuted method random.Generator.permuted(x, axis=None, out=None)
Randomly permute x along axis axis. Unlike shuffle, each slice along the given axis is shuffled independently of the others. Parameters
xarray_like, at least one-dimensional
Array to be shuffled.
axisint, optional
Sli... | numpy.reference.random.generated.numpy.random.generator.permuted |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.