# numpy.polynomial.Polynomial ¶

class numpy.polynomial. Polynomial ( coef , domain = None , window = None ) [source]

A power series class.

The Polynomial class provides the standard Python numerical methods ‘+’, ‘-‘, ‘*’, ‘//’, ‘%’, ‘divmod’, ‘**’, and ‘()’ as well as the attributes and methods listed in the ABCPolyBase documentation.

Parameters
coef array_like

Polynomial coefficients in order of increasing degree, i.e., ``` (1, 2, 3) ``` give ``` 1 + 2*x + 3*x**2 ``` .

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].

New in version 1.6.0.

Attributes
basis_name

Methods

 ``` __call__ ``` (arg) Call self as a function. ``` basis ``` (deg[, domain, window]) Series basis polynomial of degree deg . ``` cast ``` (series[, domain, window]) Convert series to series of this class. ``` convert ``` ([domain, kind, window]) Convert series to a different kind and/or domain and/or window. Return a copy. Truncate series to the given degree. The degree of the series. Differentiate. ``` fit ``` (x, y, deg[, domain, rcond, full, w, window]) Least squares fit to data. ``` fromroots ``` (roots[, domain, window]) Return series instance that has the specified roots. Check if coefficients match. Check if domains match. Check if types match. Check if windows match. Identity function. Integrate. Return x, y values at equally spaced points in domain. Return the mapping parameters. Return the roots of the series polynomial. Remove trailing coefficients Truncate series to length size .

Methods

 ``` basis ``` (deg[, domain, window]) Series basis polynomial of degree deg . ``` cast ``` (series[, domain, window]) Convert series to series of this class. ``` convert ``` ([domain, kind, window]) Convert series to a different kind and/or domain and/or window. Return a copy. Truncate series to the given degree. The degree of the series. Differentiate. ``` fit ``` (x, y, deg[, domain, rcond, full, w, window]) Least squares fit to data. ``` fromroots ``` (roots[, domain, window]) Return series instance that has the specified roots. Check if coefficients match. Check if domains match. Check if types match. Check if windows match. Identity function. Integrate. Return x, y values at equally spaced points in domain. Return the mapping parameters. Return the roots of the series polynomial. Remove trailing coefficients Truncate series to length size .

Properties