numpy.polynomial.Polynomial

class numpy.polynomial.Polynomial(coef, domain=[-1, 1], window=[-1, 1])

A Polynomial series class.

Polynomial instances provide the standard Python numerical methods ‘+’, ‘-‘, ‘*’, ‘//’, ‘%’, ‘divmod’, ‘**’, and ‘()’ as well as the listed methods.

Parameters :

coef : array_like

Polynomial coefficients, in increasing order. For example, (1, 2, 3) implies P_0 + 2P_1 + 3P_2 where the P_i are a graded polynomial basis.

domain : (2,) array_like, optional

Domain to use. The interval [domain[0], domain[1]] is mapped to the interval [window[0], window[1]] by shifting and scaling. The default value is [-1,1].

window : (2,) array_like, optional

Window, see domain for its use. The default value is [-1,1]. .. versionadded:: 1.6.0

Notes

It is important to specify the domain in many cases, for instance in fitting data, because many of the important properties of the polynomial basis only hold in a specified interval and consequently the data must be mapped into that interval in order to benefit.

Attributes

domain
window
coef (N,) array Polynomial coefficients, from low to high.

Methods

__call__
convert
copy
cutdeg
degree
deriv
fit
fromroots
has_samecoef
has_samedomain
has_samewindow
identity
integ
linspace
mapparms
roots
trim
truncate

This Page