class ABCPolyBase(abc.ABC):
Known subclasses: numpy.polynomial.chebyshev.Chebyshev
, numpy.polynomial.hermite.Hermite
, numpy.polynomial.hermite_e.HermiteE
, numpy.polynomial.laguerre.Laguerre
, numpy.polynomial.legendre.Legendre
, numpy.polynomial.polynomial.Polynomial
An abstract base class for immutable series classes.
ABCPolyBase provides the standard Python numerical methods '+', '-', '*', '//', '%', 'divmod', '**', and '()' along with the methods listed below.
Class Method | basis |
Series basis polynomial of degree deg . |
Class Method | cast |
Convert series to series of this class. |
Class Method | fit |
Least squares fit to data. |
Class Method | fromroots |
Return series instance that has the specified roots. |
Class Method | identity |
Identity function. |
Class Method | _repr_latex_term |
Undocumented |
Class Method | _str_term_ascii |
String representation of a single polynomial term using ** and _ to represent superscripts and subscripts, respectively. |
Class Method | _str_term_unicode |
String representation of single polynomial term using unicode characters for superscripts and subscripts. |
Static Method | _add |
Undocumented |
Static Method | _der |
Undocumented |
Static Method | _div |
Undocumented |
Static Method | _fit |
Undocumented |
Static Method | _fromroots |
Undocumented |
Static Method | _int |
Undocumented |
Static Method | _line |
Undocumented |
Static Method | _mul |
Undocumented |
Static Method | _pow |
Undocumented |
Static Method | _repr_latex_scalar |
Undocumented |
Static Method | _roots |
Undocumented |
Static Method | _sub |
Undocumented |
Static Method | _val |
Undocumented |
Method | __add__ |
Undocumented |
Method | __call__ |
Undocumented |
Method | __divmod__ |
Undocumented |
Method | __eq__ |
Undocumented |
Method | __floordiv__ |
Undocumented |
Method | __format__ |
Undocumented |
Method | __getstate__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | __mod__ |
Undocumented |
Method | __mul__ |
Undocumented |
Method | __ne__ |
Undocumented |
Method | __neg__ |
Undocumented |
Method | __pos__ |
Undocumented |
Method | __pow__ |
Undocumented |
Method | __radd__ |
Undocumented |
Method | __rdiv__ |
Undocumented |
Method | __rdivmod__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __rfloordiv__ |
Undocumented |
Method | __rmod__ |
Undocumented |
Method | __rmul__ |
Undocumented |
Method | __rsub__ |
Undocumented |
Method | __rtruediv__ |
Undocumented |
Method | __setstate__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | __sub__ |
Undocumented |
Method | __truediv__ |
Undocumented |
Method | _generate_string |
Generate the full string representation of the polynomial, using term_method to generate each polynomial term. |
Method | _get_coefficients |
Interpret other as polynomial coefficients. |
Method | _repr_latex_ |
Undocumented |
Method | convert |
Convert series to a different kind and/or domain and/or window. |
Method | copy |
Return a copy. |
Method | cutdeg |
Truncate series to the given degree. |
Method | degree |
The degree of the series. |
Method | deriv |
Differentiate. |
Method | has_samecoef |
Check if coefficients match. |
Method | has_samedomain |
Check if domains match. |
Method | has_sametype |
Check if types match. |
Method | has_samewindow |
Check if windows match. |
Method | integ |
Integrate. |
Method | linspace |
Return x, y values at equally spaced points in domain. |
Method | mapparms |
Return the mapping parameters. |
Method | roots |
Return the roots of the series polynomial. |
Method | trim |
Remove trailing coefficients |
Method | truncate |
Truncate series to length size . |
Class Variable | __array_ufunc__ |
Undocumented |
Class Variable | __hash__ |
Undocumented |
Class Variable | _subscript_mapping |
Undocumented |
Class Variable | _superscript_mapping |
Undocumented |
Class Variable | _use_unicode |
Undocumented |
Class Variable | maxpower |
Undocumented |
Instance Variable | __dict__ |
Undocumented |
Instance Variable | coef |
Undocumented |
Instance Variable | domain |
Undocumented |
Instance Variable | window |
Undocumented |
Property | basis_name |
Undocumented |
Series basis polynomial of degree deg
.
Returns the series representing the basis polynomial of degree deg
.
deg
term set to one and
all others zero.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.
series
when evaluated.convert : similar instance method
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.
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.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.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.
Window to use for the returned series. The default value is the default class domain
These values are only returned if full == True
rcond
.For more details, see linalg.lstsq
.
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.
Identity function.
If p is the returned series, then p(x) == x for all values of x.
numpy.polynomial.polynomial.Polynomial
Undocumented
numpy.polynomial.polynomial.Polynomial
numpy.polynomial.polynomial.Polynomial
Interpret other as polynomial coefficients.
The other
argument is checked to see if it is of the same
class as self with identical domain and window. If so,
return its coefficients, otherwise return other
.
other
.other
is an incompatible instance of ABCPolyBase.Convert series to a different kind and/or domain and/or window.
kind
is used.kind
is used.Conversion between domains and class types can result in numerically ill defined series.
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.
deg
by discarding the high
order terms. The value of deg
must be a non-negative integer.The degree of the series.
Differentiate.
Return a series instance of that is the derivative of the current series.
m
.Check if coefficients match.
Check if domains match.
Check if types match.
Check if windows match.
Integrate.
Return a series instance that is the definite integral of the current series.
m
in length and any
missing values are set to zero.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.
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.
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
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.
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.
tol
will be removed.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.
size
by discarding the high
degree terms. The value of size
must be a positive integer.