neulab/docprompting-conala huggingface dataset:
numpy.polynomial.chebyshev.chebmul   polynomial.chebyshev.chebmul(c1, c2)[source]
 
Multiply one Chebyshev series by another. Returns the product of two Chebyshev series c1 * c2. The arguments are sequences of coefficients, from lowest order “term” to highest, e.g., [1,2,3] represents the series T_0 + 2*T_1 + 3*T_2.  Parameters 
 
c1, c2array_like


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


Of Chebyshev series coefficients representing their product.      See also  
chebadd, chebsub, chebmulx, chebdiv, chebpow

  Notes In general, the (polynomial) product of two C-series results in terms that are not in the Chebyshev polynomial basis set. Thus, to express the product as a C-series, it is typically necessary to “reproject” the product onto said basis set, which typically produces “unintuitive live” (but correct) results; see Examples section below. Examples >>> from numpy.polynomial import chebyshev as C
>>> c1 = (1,2,3)
>>> c2 = (3,2,1)
>>> C.chebmul(c1,c2) # multiplication requires "reprojection"
array([  6.5,  12. ,  12. ,   4. ,   1.5])
numpy.polynomial.chebyshev.chebmulx   polynomial.chebyshev.chebmulx(c)[source]
 
Multiply a Chebyshev series by x. Multiply the polynomial c by x, where x is the independent variable.  Parameters 
 
carray_like


1-D array of Chebyshev series coefficients ordered from low to high.    Returns 
 
outndarray


Array representing the result of the multiplication.     Notes  New in version 1.5.0.  Examples >>> from numpy.polynomial import chebyshev as C
>>> C.chebmulx([1,2,3])
array([1. , 2.5, 1. , 1.5])
numpy.polynomial.chebyshev.chebpow   polynomial.chebyshev.chebpow(c, pow, maxpower=16)[source]
 
Raise a Chebyshev series to a power. Returns the Chebyshev series 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 T_0 + 2*T_1 + 3*T_2.  Parameters 
 
carray_like


1-D array of Chebyshev series coefficients ordered from low to high.  
powinteger


Power to which the series will be raised  
maxpowerinteger, optional


Maximum power allowed. This is mainly to limit growth of the series to unmanageable size. Default is 16    Returns 
 
coefndarray


Chebyshev series of power.      See also  
chebadd, chebsub, chebmulx, chebmul, chebdiv

  Examples >>> from numpy.polynomial import chebyshev as C
>>> C.chebpow([1, 2, 3, 4], 2)
array([15.5, 22. , 16. , ..., 12.5, 12. ,  8. ])
numpy.polynomial.chebyshev.chebpts1   polynomial.chebyshev.chebpts1(npts)[source]
 
Chebyshev points of the first kind. The Chebyshev points of the first kind are the points cos(x), where x = [pi*(k + .5)/npts for k in range(npts)].  Parameters 
 
nptsint


Number of sample points desired.    Returns 
 
ptsndarray


The Chebyshev points of the first kind.      See also  chebpts2
  Notes  New in version 1.5.0.
numpy.polynomial.chebyshev.chebpts2   polynomial.chebyshev.chebpts2(npts)[source]
 
Chebyshev points of the second kind. The Chebyshev points of the second kind are the points cos(x), where x = [pi*k/(npts - 1) for k in range(npts)].  Parameters 
 
nptsint


Number of sample points desired.    Returns 
 
ptsndarray


The Chebyshev points of the second kind.     Notes  New in version 1.5.0.
numpy.polynomial.chebyshev.chebroots   polynomial.chebyshev.chebroots(c)[source]
 
Compute the roots of a Chebyshev series. Return the roots (a.k.a. “zeros”) of the polynomial  \[p(x) = \sum_i c[i] * T_i(x).\]  Parameters 
 
c1-D array_like


1-D array of coefficients.    Returns 
 
outndarray


Array of the roots of the series. If all the roots are real, then out is also real, otherwise it is complex.      See also  numpy.polynomial.polynomial.polyroots
numpy.polynomial.legendre.legroots
numpy.polynomial.laguerre.lagroots
numpy.polynomial.hermite.hermroots
numpy.polynomial.hermite_e.hermeroots
  Notes The root estimates are obtained as the eigenvalues of the companion matrix, Roots far from the origin of the complex plane may have large errors due to the numerical instability of the series for such values. Roots with multiplicity greater than 1 will also show larger errors as the value of the series near such points is relatively insensitive to errors in the roots. Isolated roots near the origin can be improved by a few iterations of Newton’s method. The Chebyshev series basis polynomials aren’t powers of x so the results of this function may seem unintuitive. Examples >>> import numpy.polynomial.chebyshev as cheb
>>> cheb.chebroots((-1, 1,-1, 1)) # T3 - T2 + T1 - T0 has real roots
array([ -5.00000000e-01,   2.60860684e-17,   1.00000000e+00]) # may vary
numpy.polynomial.chebyshev.chebsub   polynomial.chebyshev.chebsub(c1, c2)[source]
 
Subtract one Chebyshev series from another. Returns the difference of two Chebyshev series c1 - c2. The sequences of coefficients are from lowest order term to highest, i.e., [1,2,3] represents the series T_0 + 2*T_1 + 3*T_2.  Parameters 
 
c1, c2array_like


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


Of Chebyshev series coefficients representing their difference.      See also  
chebadd, chebmulx, chebmul, chebdiv, chebpow

  Notes Unlike multiplication, division, etc., the difference of two Chebyshev series is a Chebyshev 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 import chebyshev as C
>>> c1 = (1,2,3)
>>> c2 = (3,2,1)
>>> C.chebsub(c1,c2)
array([-2.,  0.,  2.])
>>> C.chebsub(c2,c1) # -C.chebsub(c1,c2)
array([ 2.,  0., -2.])
numpy.polynomial.chebyshev.chebtrim   polynomial.chebyshev.chebtrim(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.chebyshev.chebval   polynomial.chebyshev.chebval(x, c, tensor=True)[source]
 
Evaluate a Chebyshev series at points x. If c is of length n + 1, this function returns the value:  \[p(x) = c_0 * T_0(x) + c_1 * T_1(x) + ... + c_n * T_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  
chebval2d, chebgrid2d, chebval3d, chebgrid3d

  Notes The evaluation uses Clenshaw recursion, aka synthetic division.
numpy.polynomial.chebyshev.chebval2d   polynomial.chebyshev.chebval2d(x, y, c)[source]
 
Evaluate a 2-D Chebyshev series at points (x, y). This function returns the values:  \[p(x,y) = \sum_{i,j} c_{i,j} * T_i(x) * T_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 2 the remaining indices enumerate multiple sets of coefficients.    Returns 
 
valuesndarray, compatible object


The values of the two dimensional Chebyshev series at points formed from pairs of corresponding values from x and y.      See also  
chebval, chebgrid2d, chebval3d, chebgrid3d

  Notes  New in version 1.7.0.
numpy.polynomial.chebyshev.chebval3d   polynomial.chebyshev.chebval3d(x, y, z, c)[source]
 
Evaluate a 3-D Chebyshev series at points (x, y, z). This function returns the values:  \[p(x,y,z) = \sum_{i,j,k} c_{i,j,k} * T_i(x) * T_j(y) * T_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  
chebval, chebval2d, chebgrid2d, chebgrid3d

  Notes  New in version 1.7.0.
numpy.polynomial.chebyshev.chebvander   polynomial.chebyshev.chebvander(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] = T_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 Chebyshev polynomial. If c is a 1-D array of coefficients of length n + 1 and V is the matrix V = chebvander(x, n), then np.dot(V, c) and chebval(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 Chebyshev 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 Chebyshev polynomial. The dtype will be the same as the converted x.
numpy.polynomial.chebyshev.chebvander2d   polynomial.chebyshev.chebvander2d(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] = T_i(x) * T_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 Chebyshev polynomials. If V = chebvander2d(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 chebval2d(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 Chebyshev 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  
chebvander, chebvander3d, chebval2d, chebval3d

  Notes  New in version 1.7.0.
numpy.polynomial.chebyshev.chebvander3d   polynomial.chebyshev.chebvander3d(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] = T_i(x)*T_j(y)*T_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 Chebyshev polynomials. If V = chebvander3d(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 chebval3d(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 Chebyshev 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  
chebvander, chebvander3d, chebval2d, chebval3d

  Notes  New in version 1.7.0.
numpy.polynomial.chebyshev.chebweight   polynomial.chebyshev.chebweight(x)[source]
 
The weight function of the Chebyshev polynomials. The weight function is \(1/\sqrt{1 - x^2}\) and the interval of integration is \([-1, 1]\). The Chebyshev 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.chebyshev.Chebyshev.__call__ method   polynomial.chebyshev.Chebyshev.__call__(arg)[source]
 
Call self as a function.
numpy.polynomial.chebyshev.Chebyshev.basis method   classmethod polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.cast method   classmethod polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.convert method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.copy method   polynomial.chebyshev.Chebyshev.copy()[source]
 
Return a copy.  Returns 
 
new_seriesseries


Copy of self.
numpy.polynomial.chebyshev.Chebyshev.cutdeg method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.degree method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.deriv method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.domain attribute   polynomial.chebyshev.Chebyshev.domain = array([-1, 1])
numpy.polynomial.chebyshev.Chebyshev.fit method   classmethod polynomial.chebyshev.Chebyshev.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.