neulab/docprompting-conala huggingface dataset:
numpy.polynomial.chebyshev.Chebyshev.fromroots method   classmethod polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.has_samecoef method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.has_samedomain method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.has_sametype method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.has_samewindow method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.identity method   classmethod polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.integ method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.interpolate method   classmethod polynomial.chebyshev.Chebyshev.interpolate(func, deg, domain=None, args=())[source]
 
Interpolate a function at the Chebyshev points of the first kind. Returns the series that interpolates func at the Chebyshev points of the first kind scaled and shifted to the domain. The resulting series tends to a minmax approximation of func when the function is continuous in the domain.  New in version 1.14.0.   Parameters 
 
funcfunction


The function to be interpolated. It must be a function of a single variable of the form f(x, a, b, c...), where a, b, c... are extra arguments passed in the args parameter.  
degint


Degree of the interpolating polynomial.  
domain{None, [beg, end]}, optional


Domain over which func is interpolated. The default is None, in which case the domain is [-1, 1].  
argstuple, optional


Extra arguments to be used in the function call. Default is no extra arguments.    Returns 
 
polynomialChebyshev instance


Interpolating Chebyshev instance.     Notes See numpy.polynomial.chebfromfunction for more details.
numpy.polynomial.chebyshev.Chebyshev.linspace method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.mapparms method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.roots method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.trim method   polynomial.chebyshev.Chebyshev.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.chebyshev.Chebyshev.truncate method   polynomial.chebyshev.Chebyshev.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.chebyshev.poly2cheb   polynomial.chebyshev.poly2cheb(pol)[source]
 
Convert a polynomial to a Chebyshev 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 Chebyshev 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 Chebyshev series.      See also  cheb2poly
  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
>>> p = P.Polynomial(range(4))
>>> p
Polynomial([0., 1., 2., 3.], domain=[-1,  1], window=[-1,  1])
>>> c = p.convert(kind=P.Chebyshev)
>>> c
Chebyshev([1.  , 3.25, 1.  , 0.75], domain=[-1.,  1.], window=[-1.,  1.])
>>> P.chebyshev.poly2cheb(range(4))
array([1.  , 3.25, 1.  , 0.75])
numpy.polynomial.hermite.herm2poly   polynomial.hermite.herm2poly(c)[source]
 
Convert a Hermite series to a polynomial. Convert an array representing the coefficients of a Hermite 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 Hermite 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  poly2herm
  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.hermite import herm2poly
>>> herm2poly([ 1.   ,  2.75 ,  0.5  ,  0.375])
array([0., 1., 2., 3.])
numpy.polynomial.hermite.hermadd   polynomial.hermite.hermadd(c1, c2)[source]
 
Add one Hermite series to another. Returns the sum of two Hermite 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 Hermite series coefficients ordered from low to high.    Returns 
 
outndarray


Array representing the Hermite series of their sum.      See also  
hermsub, hermmulx, hermmul, hermdiv, hermpow

  Notes Unlike multiplication, division, etc., the sum of two Hermite series is a Hermite 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.hermite import hermadd
>>> hermadd([1, 2, 3], [1, 2, 3, 4])
array([2., 4., 6., 4.])
numpy.polynomial.hermite.hermcompanion   polynomial.hermite.hermcompanion(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 Hermite 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 Hermite 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.hermite.hermder   polynomial.hermite.hermder(c, m=1, scl=1, axis=0)[source]
 
Differentiate a Hermite series. Returns the Hermite 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*H_0 + 2*H_1 + 3*H_2 while [[1,2],[1,2]] represents 1*H_0(x)*H_0(y) + 1*H_1(x)*H_0(y) +
2*H_0(x)*H_1(y) + 2*H_1(x)*H_1(y) if axis=0 is x and axis=1 is y.  Parameters 
 
carray_like


Array of Hermite 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


Hermite series of the derivative.      See also  hermint
  Notes In general, the result of differentiating a Hermite 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.hermite import hermder
>>> hermder([ 1. ,  0.5,  0.5,  0.5])
array([1., 2., 3.])
>>> hermder([-0.5,  1./2.,  1./8.,  1./12.,  1./16.], m=2)
array([1., 2., 3.])
numpy.polynomial.hermite.hermdiv   polynomial.hermite.hermdiv(c1, c2)[source]
 
Divide one Hermite series by another. Returns the quotient-with-remainder of two Hermite 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 Hermite series coefficients ordered from low to high.    Returns 
 
[quo, rem]ndarrays


Of Hermite series coefficients representing the quotient and remainder.      See also  
hermadd, hermsub, hermmulx, hermmul, hermpow

  Notes In general, the (polynomial) division of one Hermite series by another results in quotient and remainder terms that are not in the Hermite polynomial basis set. Thus, to express these results as a Hermite series, it is necessary to “reproject” the results onto the Hermite basis set, which may produce “unintuitive” (but correct) results; see Examples section below. Examples >>> from numpy.polynomial.hermite import hermdiv
>>> hermdiv([ 52.,  29.,  52.,   7.,   6.], [0, 1, 2])
(array([1., 2., 3.]), array([0.]))
>>> hermdiv([ 54.,  31.,  52.,   7.,   6.], [0, 1, 2])
(array([1., 2., 3.]), array([2., 2.]))
>>> hermdiv([ 53.,  30.,  52.,   7.,   6.], [0, 1, 2])
(array([1., 2., 3.]), array([1., 1.]))
numpy.polynomial.hermite.hermfromroots   polynomial.hermite.hermfromroots(roots)[source]
 
Generate a Hermite series with given roots. The function returns the coefficients of the polynomial  \[p(x) = (x - r_0) * (x - r_1) * ... * (x - r_n),\] in Hermite 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 * H_1(x) + ... + c_n * H_n(x)\] The coefficient of the last term is not generally 1 for monic polynomials in Hermite 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.legendre.legfromroots
numpy.polynomial.laguerre.lagfromroots
numpy.polynomial.chebyshev.chebfromroots
numpy.polynomial.hermite_e.hermefromroots
  Examples >>> from numpy.polynomial.hermite import hermfromroots, hermval
>>> coef = hermfromroots((-1, 0, 1))
>>> hermval((-1, 0, 1), coef)
array([0.,  0.,  0.])
>>> coef = hermfromroots((-1j, 1j))
>>> hermval((-1j, 1j), coef)
array([0.+0.j, 0.+0.j])
numpy.polynomial.hermite.hermgauss   polynomial.hermite.hermgauss(deg)[source]
 
Gauss-Hermite quadrature. Computes the sample points and weights for Gauss-Hermite quadrature. These sample points and weights will correctly integrate polynomials of degree \(2*deg - 1\) or less over the interval \([-\inf, \inf]\) with the weight function \(f(x) = \exp(-x^2)\).  Parameters 
 
degint


Number of sample points and weights. It must be >= 1.    Returns 
 
xndarray


1-D ndarray containing the sample points.  
yndarray


1-D ndarray containing the weights.     Notes  New in version 1.7.0.  The results have only been tested up to degree 100, higher degrees may be problematic. The weights are determined by using the fact that  \[w_k = c / (H'_n(x_k) * H_{n-1}(x_k))\] where \(c\) is a constant independent of \(k\) and \(x_k\) is the k’th root of \(H_n\), and then scaling the results to get the right value when integrating 1.
numpy.polynomial.hermite.hermgrid2d   polynomial.hermite.hermgrid2d(x, y, c)[source]
 
Evaluate a 2-D Hermite series on the Cartesian product of x and y. This function returns the values:  \[p(a,b) = \sum_{i,j} c_{i,j} * H_i(a) * H_j(b)\] where the points (a, b) consist of all pairs formed by taking a from x and b from y. The resulting points form a grid with x in the first dimension and y in the second. The parameters x and y are converted to arrays only if they are tuples or a lists, otherwise they are treated as a scalars. 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 has fewer than two dimensions, ones are 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 in the Cartesian product of x and y. 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 coefficients for terms of degree i,j are 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 in the Cartesian product of x and y.      See also  
hermval, hermval2d, hermval3d, hermgrid3d

  Notes  New in version 1.7.0.
numpy.polynomial.hermite.hermgrid3d   polynomial.hermite.hermgrid3d(x, y, z, c)[source]
 
Evaluate a 3-D Hermite series 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} * H_i(a) * H_j(b) * H_k(c)\] where the points (a, b, c) consist of all triples formed by taking a from x, b from y, and c from z. The resulting points form a grid with x in the first dimension, y in the second, and z in the third. 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. 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 three 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 + y.shape + z.shape.  Parameters 
 
x, y, zarray_like, compatible objects


The three dimensional series is evaluated at the points in the Cartesian product of x, y, and z. If 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 coefficients for terms of degree i,j are 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 in the Cartesian product of x and y.      See also  
hermval, hermval2d, hermgrid2d, hermval3d

  Notes  New in version 1.7.0.
numpy.polynomial.hermite.hermint   polynomial.hermite.hermint(c, m=1, k=[], lbnd=0, scl=1, axis=0)[source]
 
Integrate a Hermite series. Returns the Hermite series 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. The scaling factor is for use in a linear change of variable. (“Buyer beware”: note that, depending on what one is doing, one may want scl to be the reciprocal of what one might expect; for more information, see the Notes section below.) The argument c is an array of coefficients from low to high degree along each axis, e.g., [1,2,3] represents the series H_0 + 2*H_1 + 3*H_2 while [[1,2],[1,2]] represents 1*H_0(x)*H_0(y) + 1*H_1(x)*H_0(y) + 2*H_0(x)*H_1(y) +
2*H_1(x)*H_1(y) if axis=0 is x and axis=1 is y.  Parameters 
 
carray_like


Array of Hermite 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


Order of integration, must be positive. (Default: 1)  
k{[], list, scalar}, optional


Integration constant(s). The value of the first integral at lbnd is the first value in the list, the value of the second integral at lbnd is the second value, etc. If k == [] (the default), all constants are set to zero. If m == 1, a single scalar can be given instead of a list.  
lbndscalar, optional


The lower bound of the integral. (Default: 0)  
sclscalar, optional


Following each integration the result is multiplied by scl before the integration constant is added. (Default: 1)  
axisint, optional


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


Hermite series coefficients of the integral.    Raises 
 ValueError

If m < 0, len(k) > m, np.ndim(lbnd) != 0, or np.ndim(scl) != 0.      See also  hermder
  Notes Note that the result of each integration is multiplied by scl. Why is this important to note? Say one is making a linear change of variable \(u = ax + b\) in an integral relative to x. Then \(dx = du/a\), so one will need to set scl equal to \(1/a\) - perhaps not what one would have first thought. Also note that, in general, the result of integrating a C-series needs to be “reprojected” onto the C-series basis set. Thus, typically, the result of this function is “unintuitive,” albeit correct; see Examples section below. Examples >>> from numpy.polynomial.hermite import hermint
>>> hermint([1,2,3]) # integrate once, value 0 at 0.
array([1. , 0.5, 0.5, 0.5])
>>> hermint([1,2,3], m=2) # integrate twice, value & deriv 0 at 0
array([-0.5       ,  0.5       ,  0.125     ,  0.08333333,  0.0625    ]) # may vary
>>> hermint([1,2,3], k=1) # integrate once, value 1 at 0.
array([2. , 0.5, 0.5, 0.5])
>>> hermint([1,2,3], lbnd=-1) # integrate once, value 0 at -1
array([-2. ,  0.5,  0.5,  0.5])
>>> hermint([1,2,3], m=2, k=[1,2], lbnd=-1)
array([ 1.66666667, -0.5       ,  0.125     ,  0.08333333,  0.0625    ]) # may vary
numpy.polynomial.hermite.Hermite.__call__ method   polynomial.hermite.Hermite.__call__(arg)[source]
 
Call self as a function.
numpy.polynomial.hermite.Hermite.basis method   classmethod polynomial.hermite.Hermite.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.