neulab/docprompting-conala huggingface dataset:
numpy.polynomial.laguerre.lagsub   polynomial.laguerre.lagsub(c1, c2)[source]
 
Subtract one Laguerre series from another. Returns the difference of two Laguerre series c1 - c2. The sequences of coefficients are 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 Laguerre series coefficients ordered from low to high.    Returns 
 
outndarray


Of Laguerre series coefficients representing their difference.      See also  
lagadd, lagmulx, lagmul, lagdiv, lagpow

  Notes Unlike multiplication, division, etc., the difference of two Laguerre series is a Laguerre series (without having to “reproject” the result onto the basis set) so subtraction, just like that of “standard” polynomials, is simply “component-wise.” Examples >>> from numpy.polynomial.laguerre import lagsub
>>> lagsub([1, 2, 3, 4], [1, 2, 3])
array([0.,  0.,  0.,  4.])
numpy.polynomial.laguerre.lagtrim   polynomial.laguerre.lagtrim(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 + x + x**2 + 0*x**3 + 0*x**4) both the 3-rd and 4-th order coefficients would be “trimmed.”  Parameters 
 
carray_like


1-d array of coefficients, ordered from lowest order to highest.  
tolnumber, optional


Trailing (i.e., highest order) elements with absolute value less than or equal to tol (default value is zero) are removed.    Returns 
 
trimmedndarray


1-d array with trailing zeros removed. If the resulting series would be empty, a series containing a single zero is returned.    Raises 
 ValueError

If tol < 0      See also  trimseq
  Examples >>> from numpy.polynomial import polyutils as pu
>>> pu.trimcoef((0,0,3,0,5,0,0))
array([0.,  0.,  3.,  0.,  5.])
>>> pu.trimcoef((0,0,1e-3,0,1e-5,0,0),1e-3) # item == tol is trimmed
array([0.])
>>> i = complex(0,1) # works for complex
>>> pu.trimcoef((3e-4,1e-3*(1-i),5e-4,2e-5*(1+i)), 1e-3)
array([0.0003+0.j   , 0.001 -0.001j])
numpy.polynomial.laguerre.Laguerre.__call__ method   polynomial.laguerre.Laguerre.__call__(arg)[source]
 
Call self as a function.
numpy.polynomial.laguerre.Laguerre.basis method   classmethod polynomial.laguerre.Laguerre.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.laguerre.Laguerre.cast method   classmethod polynomial.laguerre.Laguerre.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.laguerre.Laguerre.convert method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.copy method   polynomial.laguerre.Laguerre.copy()[source]
 
Return a copy.  Returns 
 
new_seriesseries


Copy of self.
numpy.polynomial.laguerre.Laguerre.cutdeg method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.degree method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.deriv method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.domain attribute   polynomial.laguerre.Laguerre.domain = array([0, 1])
numpy.polynomial.laguerre.Laguerre.fit method   classmethod polynomial.laguerre.Laguerre.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.laguerre.Laguerre.fromroots method   classmethod polynomial.laguerre.Laguerre.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.laguerre.Laguerre.has_samecoef method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.has_samedomain method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.has_sametype method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.has_samewindow method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.identity method   classmethod polynomial.laguerre.Laguerre.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.laguerre.Laguerre.integ method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.linspace method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.mapparms method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.roots method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.trim method   polynomial.laguerre.Laguerre.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.laguerre.Laguerre.truncate method   polynomial.laguerre.Laguerre.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.laguerre.lagval   polynomial.laguerre.lagval(x, c, tensor=True)[source]
 
Evaluate a Laguerre series at points x. If c is of length n + 1, this function returns the value:  \[p(x) = c_0 * L_0(x) + c_1 * L_1(x) + ... + c_n * L_n(x)\] The parameter x is converted to an array only if it is a tuple or a list, otherwise it is treated as a scalar. In either case, either x or its elements must support multiplication and addition both with themselves and with the elements of c. If c is a 1-D array, then p(x) will have the same shape as x. If c is multidimensional, then the shape of the result depends on the value of tensor. If tensor is true the shape will be c.shape[1:] + x.shape. If tensor is false the shape will be c.shape[1:]. Note that scalars have shape (,). Trailing zeros in the coefficients will be used in the evaluation, so they should be avoided if efficiency is a concern.  Parameters 
 
xarray_like, compatible object


If x is a list or tuple, it is converted to an ndarray, otherwise it is left unchanged and treated as a scalar. In either case, x or its elements must support addition and multiplication with with themselves and with the elements of c.  
carray_like


Array of coefficients ordered so that the coefficients for terms of degree n are contained in c[n]. If c is multidimensional the remaining indices enumerate multiple polynomials. In the two dimensional case the coefficients may be thought of as stored in the columns of c.  
tensorboolean, optional


If True, the shape of the coefficient array is extended with ones on the right, one for each dimension of x. Scalars have dimension 0 for this action. The result is that every column of coefficients in c is evaluated for every element of x. If False, x is broadcast over the columns of c for the evaluation. This keyword is useful when c is multidimensional. The default value is True.  New in version 1.7.0.     Returns 
 
valuesndarray, algebra_like


The shape of the return value is described above.      See also  
lagval2d, laggrid2d, lagval3d, laggrid3d

  Notes The evaluation uses Clenshaw recursion, aka synthetic division. Examples >>> from numpy.polynomial.laguerre import lagval
>>> coef = [1,2,3]
>>> lagval(1, coef)
-0.5
>>> lagval([[1,2],[3,4]], coef)
array([[-0.5, -4. ],
       [-4.5, -2. ]])
numpy.polynomial.laguerre.lagval2d   polynomial.laguerre.lagval2d(x, y, c)[source]
 
Evaluate a 2-D Laguerre series at points (x, y). This function returns the values:  \[p(x,y) = \sum_{i,j} c_{i,j} * L_i(x) * L_j(y)\] The parameters x and y are converted to arrays only if they are tuples or a lists, otherwise they are treated as a scalars and they must have the same shape after conversion. In either case, either x and y or their elements must support multiplication and addition both with themselves and with the elements of c. If c is a 1-D array a one is implicitly appended to its shape to make it 2-D. The shape of the result will be c.shape[2:] + x.shape.  Parameters 
 
x, yarray_like, compatible objects


The two dimensional series is evaluated at the points (x, y), where x and y must have the same shape. If x or y is a list or tuple, it is first converted to an ndarray, otherwise it is left unchanged and if it isn’t an ndarray it is treated as a scalar.  
carray_like


Array of coefficients ordered so that the coefficient of the term of multi-degree i,j is contained in c[i,j]. If c has dimension greater than two the remaining indices enumerate multiple sets of coefficients.    Returns 
 
valuesndarray, compatible object


The values of the two dimensional polynomial at points formed with pairs of corresponding values from x and y.      See also  
lagval, laggrid2d, lagval3d, laggrid3d

  Notes  New in version 1.7.0.
numpy.polynomial.laguerre.lagval3d   polynomial.laguerre.lagval3d(x, y, z, c)[source]
 
Evaluate a 3-D Laguerre series at points (x, y, z). This function returns the values:  \[p(x,y,z) = \sum_{i,j,k} c_{i,j,k} * L_i(x) * L_j(y) * L_k(z)\] The parameters x, y, and z are converted to arrays only if they are tuples or a lists, otherwise they are treated as a scalars and they must have the same shape after conversion. In either case, either x, y, and z or their elements must support multiplication and addition both with themselves and with the elements of c. If c has fewer than 3 dimensions, ones are implicitly appended to its shape to make it 3-D. The shape of the result will be c.shape[3:] + x.shape.  Parameters 
 
x, y, zarray_like, compatible object


The three dimensional series is evaluated at the points (x, y, z), where x, y, and z must have the same shape. If any of x, y, or z is a list or tuple, it is first converted to an ndarray, otherwise it is left unchanged and if it isn’t an ndarray it is treated as a scalar.  
carray_like


Array of coefficients ordered so that the coefficient of the term of multi-degree i,j,k is contained in c[i,j,k]. If c has dimension greater than 3 the remaining indices enumerate multiple sets of coefficients.    Returns 
 
valuesndarray, compatible object


The values of the multidimensional polynomial on points formed with triples of corresponding values from x, y, and z.      See also  
lagval, lagval2d, laggrid2d, laggrid3d

  Notes  New in version 1.7.0.
numpy.polynomial.laguerre.lagvander   polynomial.laguerre.lagvander(x, deg)[source]
 
Pseudo-Vandermonde matrix of given degree. Returns the pseudo-Vandermonde matrix of degree deg and sample points x. The pseudo-Vandermonde matrix is defined by  \[V[..., i] = L_i(x)\] where 0 <= i <= deg. The leading indices of V index the elements of x and the last index is the degree of the Laguerre polynomial. If c is a 1-D array of coefficients of length n + 1 and V is the array V = lagvander(x, n), then np.dot(V, c) and lagval(x, c) are the same up to roundoff. This equivalence is useful both for least squares fitting and for the evaluation of a large number of Laguerre series of the same degree and sample points.  Parameters 
 
xarray_like


Array of points. The dtype is converted to float64 or complex128 depending on whether any of the elements are complex. If x is scalar it is converted to a 1-D array.  
degint


Degree of the resulting matrix.    Returns 
 
vanderndarray


The pseudo-Vandermonde matrix. The shape of the returned matrix is x.shape + (deg + 1,), where The last index is the degree of the corresponding Laguerre polynomial. The dtype will be the same as the converted x.     Examples >>> from numpy.polynomial.laguerre import lagvander
>>> x = np.array([0, 1, 2])
>>> lagvander(x, 3)
array([[ 1.        ,  1.        ,  1.        ,  1.        ],
       [ 1.        ,  0.        , -0.5       , -0.66666667],
       [ 1.        , -1.        , -1.        , -0.33333333]])
numpy.polynomial.laguerre.lagvander2d   polynomial.laguerre.lagvander2d(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] = L_i(x) * L_j(y),\] where 0 <= i <= deg[0] and 0 <= j <= deg[1]. The leading indices of V index the points (x, y) and the last index encodes the degrees of the Laguerre polynomials. If V = lagvander2d(x, y, [xdeg, ydeg]), then the columns of V correspond to the elements of a 2-D coefficient array c of shape (xdeg + 1, ydeg + 1) in the order  \[c_{00}, c_{01}, c_{02} ... , c_{10}, c_{11}, c_{12} ...\] and np.dot(V, c.flat) and lagval2d(x, y, 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 2-D Laguerre series of the same degrees and sample points.  Parameters 
 
x, yarray_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].    Returns 
 
vander2dndarray


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

  Notes  New in version 1.7.0.