neulab/docprompting-conala huggingface dataset:
numpy.polynomial.laguerre.lagvander3d   polynomial.laguerre.lagvander3d(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 by  \[V[..., (m+1)(n+1)i + (n+1)j + k] = L_i(x)*L_j(y)*L_k(z),\] where 0 <= i <= l, 0 <= j <= m, and 0 <= j <= n. The leading indices of V index the points (x, y, z) and the last index encodes the degrees of the Laguerre polynomials. If V = lagvander3d(x, y, z, [xdeg, ydeg, zdeg]), then the columns of V correspond to the elements of a 3-D coefficient array c of shape (xdeg + 1, ydeg + 1, zdeg + 1) in the order  \[c_{000}, c_{001}, c_{002},... , c_{010}, c_{011}, c_{012},...\] and np.dot(V, c.flat) and lagval3d(x, y, z, c) will be the same up to roundoff. This equivalence is useful both for least squares fitting and for the evaluation of a large number of 3-D Laguerre series of the same degrees and sample points.  Parameters 
 
x, y, zarray_like


Arrays of point coordinates, all of the same shape. The dtypes will be converted to either float64 or complex128 depending on whether any of the elements are complex. Scalars are converted to 1-D arrays.  
deglist of ints


List of maximum degrees of the form [x_deg, y_deg, z_deg].    Returns 
 
vander3dndarray


The shape of the returned matrix is x.shape + (order,), where \(order = (deg[0]+1)*(deg[1]+1)*(deg[2]+1)\). The dtype will be the same as the converted x, y, and z.      See also  
lagvander, lagvander3d, lagval2d, lagval3d

  Notes  New in version 1.7.0.
numpy.polynomial.laguerre.lagweight   polynomial.laguerre.lagweight(x)[source]
 
Weight function of the Laguerre polynomials. The weight function is \(exp(-x)\) and the interval of integration is \([0, \inf]\). The Laguerre polynomials are orthogonal, but not normalized, with respect to this weight function.  Parameters 
 
xarray_like


Values at which the weight function will be computed.    Returns 
 
wndarray


The weight function at x.     Notes  New in version 1.7.0.
numpy.polynomial.laguerre.poly2lag   polynomial.laguerre.poly2lag(pol)[source]
 
Convert a polynomial to a Laguerre 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 Laguerre series, ordered from lowest to highest degree.  Parameters 
 
polarray_like


1-D array containing the polynomial coefficients    Returns 
 
cndarray


1-D array containing the coefficients of the equivalent Laguerre series.      See also  lag2poly
  Notes The easy way to do conversions between polynomial basis sets is to use the convert method of a class instance. Examples >>> from numpy.polynomial.laguerre import poly2lag
>>> poly2lag(np.arange(4))
array([ 23., -63.,  58., -18.])
numpy.polynomial.legendre.leg2poly   polynomial.legendre.leg2poly(c)[source]
 
Convert a Legendre series to a polynomial. Convert an array representing the coefficients of a Legendre series, ordered from lowest degree to highest, to an array of the coefficients of the equivalent polynomial (relative to the “standard” basis) ordered from lowest to highest degree.  Parameters 
 
carray_like


1-D array containing the Legendre series coefficients, ordered from lowest order term to highest.    Returns 
 
polndarray


1-D array containing the coefficients of the equivalent polynomial (relative to the “standard” basis) ordered from lowest order term to highest.      See also  poly2leg
  Notes The easy way to do conversions between polynomial basis sets is to use the convert method of a class instance. Examples >>> from numpy import polynomial as P
>>> c = P.Legendre(range(4))
>>> c
Legendre([0., 1., 2., 3.], domain=[-1,  1], window=[-1,  1])
>>> p = c.convert(kind=P.Polynomial)
>>> p
Polynomial([-1. , -3.5,  3. ,  7.5], domain=[-1.,  1.], window=[-1.,  1.])
>>> P.leg2poly(range(4))
array([-1. , -3.5,  3. ,  7.5])
numpy.polynomial.legendre.legadd   polynomial.legendre.legadd(c1, c2)[source]
 
Add one Legendre series to another. Returns the sum of two Legendre series c1 + c2. The arguments are sequences of coefficients ordered from lowest order term to highest, i.e., [1,2,3] represents the series P_0 + 2*P_1 + 3*P_2.  Parameters 
 
c1, c2array_like


1-D arrays of Legendre series coefficients ordered from low to high.    Returns 
 
outndarray


Array representing the Legendre series of their sum.      See also  
legsub, legmulx, legmul, legdiv, legpow

  Notes Unlike multiplication, division, etc., the sum of two Legendre series is a Legendre series (without having to “reproject” the result onto the basis set) so addition, just like that of “standard” polynomials, is simply “component-wise.” Examples >>> from numpy.polynomial import legendre as L
>>> c1 = (1,2,3)
>>> c2 = (3,2,1)
>>> L.legadd(c1,c2)
array([4.,  4.,  4.])
numpy.polynomial.legendre.legcompanion   polynomial.legendre.legcompanion(c)[source]
 
Return the scaled companion matrix of c. The basis polynomials are scaled so that the companion matrix is symmetric when c is an Legendre basis polynomial. This provides better eigenvalue estimates than the unscaled case and for basis polynomials the eigenvalues are guaranteed to be real if numpy.linalg.eigvalsh is used to obtain them.  Parameters 
 
carray_like


1-D array of Legendre series coefficients ordered from low to high degree.    Returns 
 
matndarray


Scaled companion matrix of dimensions (deg, deg).     Notes  New in version 1.7.0.
numpy.polynomial.legendre.legder   polynomial.legendre.legder(c, m=1, scl=1, axis=0)[source]
 
Differentiate a Legendre series. Returns the Legendre series 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 argument c is an array of coefficients from low to high degree along each axis, e.g., [1,2,3] represents the series 1*L_0 + 2*L_1 + 3*L_2 while [[1,2],[1,2]] represents 1*L_0(x)*L_0(y) + 1*L_1(x)*L_0(y) +
2*L_0(x)*L_1(y) + 2*L_1(x)*L_1(y) if axis=0 is x and axis=1 is y.  Parameters 
 
carray_like


Array of Legendre series coefficients. If c is multidimensional the different axis correspond to different variables with the degree in each axis given by the corresponding index.  
mint, optional


Number of derivatives taken, must be non-negative. (Default: 1)  
sclscalar, optional


Each differentiation is multiplied by scl. The end result is multiplication by scl**m. This is for use in a linear change of variable. (Default: 1)  
axisint, optional


Axis over which the derivative is taken. (Default: 0).  New in version 1.7.0.     Returns 
 
derndarray


Legendre series of the derivative.      See also  legint
  Notes In general, the result of differentiating a Legendre series does not resemble the same operation on a power series. Thus the result of this function may be “unintuitive,” albeit correct; see Examples section below. Examples >>> from numpy.polynomial import legendre as L
>>> c = (1,2,3,4)
>>> L.legder(c)
array([  6.,   9.,  20.])
>>> L.legder(c, 3)
array([60.])
>>> L.legder(c, scl=-1)
array([ -6.,  -9., -20.])
>>> L.legder(c, 2,-1)
array([  9.,  60.])
numpy.polynomial.legendre.legdiv   polynomial.legendre.legdiv(c1, c2)[source]
 
Divide one Legendre series by another. Returns the quotient-with-remainder of two Legendre series c1 / c2. The arguments are sequences of coefficients from lowest order “term” to highest, e.g., [1,2,3] represents the series P_0 + 2*P_1 + 3*P_2.  Parameters 
 
c1, c2array_like


1-D arrays of Legendre series coefficients ordered from low to high.    Returns 
 
quo, remndarrays


Of Legendre series coefficients representing the quotient and remainder.      See also  
legadd, legsub, legmulx, legmul, legpow

  Notes In general, the (polynomial) division of one Legendre series by another results in quotient and remainder terms that are not in the Legendre polynomial basis set. Thus, to express these results as a Legendre series, it is necessary to “reproject” the results onto the Legendre basis set, which may produce “unintuitive” (but correct) results; see Examples section below. Examples >>> from numpy.polynomial import legendre as L
>>> c1 = (1,2,3)
>>> c2 = (3,2,1)
>>> L.legdiv(c1,c2) # quotient "intuitive," remainder not
(array([3.]), array([-8., -4.]))
>>> c2 = (0,1,2,3)
>>> L.legdiv(c2,c1) # neither "intuitive"
(array([-0.07407407,  1.66666667]), array([-1.03703704, -2.51851852])) # may vary
numpy.polynomial.legendre.Legendre.__call__ method   polynomial.legendre.Legendre.__call__(arg)[source]
 
Call self as a function.
numpy.polynomial.legendre.Legendre.basis method   classmethod polynomial.legendre.Legendre.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 polynomial for the series. Must be >= 0.  
domain{None, array_like}, optional


If given, the array must be of the form [beg, end], where beg and end are the endpoints of the domain. If None is given then the class domain is used. The default is None.  
window{None, array_like}, optional


If given, the resulting array must be if the form [beg, end], where beg and end are the endpoints of the window. If None is given then the class window is used. The default is None.    Returns 
 
new_seriesseries


A series with the coefficient of the deg term set to one and all others zero.
numpy.polynomial.legendre.Legendre.cast method   classmethod polynomial.legendre.Legendre.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, but could be some other class that supports the convert method.  New in version 1.7.0.   Parameters 
 
seriesseries


The series instance to be converted.  
domain{None, array_like}, optional


If given, the array must be of the form [beg, end], where beg and end are the endpoints of the domain. If None is given then the class domain is used. The default is None.  
window{None, array_like}, optional


If given, the resulting array must be if the form [beg, end], where beg and end are the endpoints of the window. If None is given then the class window is used. The default is None.    Returns 
 
new_seriesseries


A series of the same kind as the calling class and equal to series when evaluated.      See also  convert

similar instance method
numpy.polynomial.legendre.Legendre.convert method   polynomial.legendre.Legendre.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 default domain of kind is used.  
kindclass, optional


The polynomial series type class to which the current instance should be converted. If kind is None, then the class of the current instance is used.  
windowarray_like, optional


The window of the converted series. If the value is None, the default window of kind is used.    Returns 
 
new_seriesseries


The returned class can be of different type than the current instance and/or have a different domain and/or different window.     Notes Conversion between domains and class types can result in numerically ill defined series.
numpy.polynomial.legendre.Legendre.copy method   polynomial.legendre.Legendre.copy()[source]
 
Return a copy.  Returns 
 
new_seriesseries


Copy of self.
numpy.polynomial.legendre.Legendre.cutdeg method   polynomial.legendre.Legendre.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 useful in least squares where the coefficients of the high degree terms may be very small.  New in version 1.5.0.   Parameters 
 
degnon-negative int


The series is reduced to degree deg by discarding the high order terms. The value of deg must be a non-negative integer.    Returns 
 
new_seriesseries


New instance of series with reduced degree.
numpy.polynomial.legendre.Legendre.degree method   polynomial.legendre.Legendre.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.polynomial.legendre.Legendre.deriv method   polynomial.legendre.Legendre.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 representing the derivative. The domain is the same as the domain of the differentiated series.
numpy.polynomial.legendre.Legendre.domain attribute   polynomial.legendre.Legendre.domain = array([-1, 1])
numpy.polynomial.legendre.Legendre.fit method   classmethod polynomial.legendre.Legendre.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 instance can be specified and this will often result in a superior fit with less chance of ill conditioning.  Parameters 
 
xarray_like, shape (M,)


x-coordinates of the M sample points (x[i], y[i]).  
yarray_like, shape (M,)


y-coordinates of the M sample points (x[i], y[i]).  
degint or 1-D array_like


Degree(s) of the fitting polynomials. If deg is a single integer all terms up to and including the deg’th term are included in the fit. For NumPy versions >= 1.11.0 a list of integers specifying the degrees of the terms to include may be used instead.  
domain{None, [beg, end], []}, optional


Domain to use for the returned series. If None, then a minimal domain that covers the points x is chosen. If [] the class domain is used. The default value was the class domain in NumPy 1.4 and None in later versions. The [] option was added in numpy 1.5.0.  
rcondfloat, optional


Relative condition number of the fit. Singular values smaller than this relative to the largest singular value will be ignored. The default value is len(x)*eps, where eps is the relative precision of the float type, about 2e-16 in most cases.  
fullbool, optional


Switch determining nature of return value. When it is False (the default) just the coefficients are returned, when True diagnostic information from the singular value decomposition is also returned.  
warray_like, shape (M,), optional


Weights. If not None, the weight w[i] applies to the unsquared residual y[i] - y_hat[i] at x[i]. Ideally the weights are chosen so that the errors of the products w[i]*y[i] all have the same variance. When using inverse-variance weighting, use w[i] = 1/sigma(y[i]). The default value is None.  New in version 1.5.0.   
window{[beg, end]}, optional


Window to use for the returned series. The default value is the default class domain  New in version 1.6.0.     Returns 
 
new_seriesseries


A series that represents the least squares fit to the data and has the domain and window specified in the call. If the coefficients for the unscaled and unshifted basis polynomials are of interest, do new_series.convert().coef.  
[resid, rank, sv, rcond]list


These values are only returned if full == True  resid – sum of squared residuals of the least squares fit rank – the numerical rank of the scaled Vandermonde matrix sv – singular values of the scaled Vandermonde matrix rcond – value of rcond.  For more details, see linalg.lstsq.
numpy.polynomial.legendre.Legendre.fromroots method   classmethod polynomial.legendre.Legendre.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.  Parameters 
 
rootsarray_like


List of roots.  
domain{[], None, array_like}, optional


Domain for the resulting series. If None the domain is the interval from the smallest root to the largest. If [] the domain is the class domain. The default is [].  
window{None, array_like}, optional


Window for the returned series. If None the class window is used. The default is None.    Returns 
 
new_seriesseries


Series with the specified roots.
numpy.polynomial.legendre.Legendre.has_samecoef method   polynomial.legendre.Legendre.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 same, False otherwise.
numpy.polynomial.legendre.Legendre.has_samedomain method   polynomial.legendre.Legendre.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 same, False otherwise.
numpy.polynomial.legendre.Legendre.has_sametype method   polynomial.legendre.Legendre.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.polynomial.legendre.Legendre.has_samewindow method   polynomial.legendre.Legendre.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 same, False otherwise.
numpy.polynomial.legendre.Legendre.identity method   classmethod polynomial.legendre.Legendre.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 form [beg, end], where beg and end are the endpoints of the domain. If None is given then the class domain is used. The default is None.  
window{None, array_like}, optional


If given, the resulting array must be if the form [beg, end], where beg and end are the endpoints of the window. If None is given then the class window is used. The default is None.    Returns 
 
new_seriesseries


Series of representing the identity.
numpy.polynomial.legendre.Legendre.integ method   polynomial.legendre.Legendre.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 constants. The first constant is applied to the first integration, the second to the second, and so on. The list of values must less than or equal to m in length and any missing values are set to zero.  
lbndScalar


The lower bound of the definite integral.    Returns 
 
new_seriesseries


A new series representing the integral. The domain is the same as the domain of the integrated series.
numpy.polynomial.legendre.Legendre.linspace method   polynomial.legendre.Legendre.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 the domain is the same as that of the series instance. This method is intended mostly as a plotting aid.  New in version 1.5.0.   Parameters 
 
nint, optional


Number of point pairs to return. The default value is 100.  
domain{None, array_like}, optional


If not None, the specified domain is used instead of that of the calling instance. It should be of the form [beg,end]. The default is None which case the class domain is used.    Returns 
 
x, yndarray


x is equal to linspace(self.domain[0], self.domain[1], n) and y is the series evaluated at element of x.
numpy.polynomial.legendre.Legendre.mapparms method   polynomial.legendre.Legendre.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 current domain is equal to the window the resulting map is the identity. If the coefficients of the series instance are to be used by themselves outside this class, then the linear function must be substituted for the x in the standard representation of the base polynomials.  Returns 
 
off, sclfloat or complex


The mapping function is defined by off + scl*x.     Notes If the current domain is the interval [l1, r1] and the window is [l2, r2], then the linear mapping function L is defined by the equations: L(l1) = l2
L(r1) = r2
numpy.polynomial.legendre.Legendre.roots method   polynomial.legendre.Legendre.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 roots of the series.
numpy.polynomial.legendre.Legendre.trim method   polynomial.legendre.Legendre.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 the series is set to [0]. A new series instance is returned with the new coefficients. The current instance remains unchanged.  Parameters 
 
tolnon-negative number.


All trailing coefficients less than tol will be removed.    Returns 
 
new_seriesseries


New instance of series with trimmed coefficients.
numpy.polynomial.legendre.Legendre.truncate method   polynomial.legendre.Legendre.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 coefficients of the high degree terms may be very small.  Parameters 
 
sizepositive int


The series is reduced to length size by discarding the high degree terms. The value of size must be a positive integer.    Returns 
 
new_seriesseries


New instance of series with truncated coefficients.
numpy.polynomial.legendre.legfromroots   polynomial.legendre.legfromroots(roots)[source]
 
Generate a Legendre series with given roots. The function returns the coefficients of the polynomial  \[p(x) = (x - r_0) * (x - r_1) * ... * (x - r_n),\] in Legendre form, where the r_n are the roots specified in roots. If a zero has multiplicity n, then it must appear in roots n times. For instance, if 2 is a root of multiplicity three and 3 is a root of multiplicity 2, then roots looks something like [2, 2, 2, 3, 3]. The roots can appear in any order. If the returned coefficients are c, then  \[p(x) = c_0 + c_1 * L_1(x) + ... + c_n * L_n(x)\] The coefficient of the last term is not generally 1 for monic polynomials in Legendre form.  Parameters 
 
rootsarray_like


Sequence containing the roots.    Returns 
 
outndarray


1-D array of coefficients. If all roots are real then out is a real array, if some of the roots are complex, then out is complex even if all the coefficients in the result are real (see Examples below).      See also  numpy.polynomial.polynomial.polyfromroots
numpy.polynomial.chebyshev.chebfromroots
numpy.polynomial.laguerre.lagfromroots
numpy.polynomial.hermite.hermfromroots
numpy.polynomial.hermite_e.hermefromroots
  Examples >>> import numpy.polynomial.legendre as L
>>> L.legfromroots((-1,0,1)) # x^3 - x relative to the standard basis
array([ 0. , -0.4,  0. ,  0.4])
>>> j = complex(0,1)
>>> L.legfromroots((-j,j)) # x^2 + 1 relative to the standard basis
array([ 1.33333333+0.j,  0.00000000+0.j,  0.66666667+0.j]) # may vary