NumPy

Previous topic

numpy.polynomial.polynomial.polydiv

Next topic

numpy.polynomial.polynomial.polycompanion

numpy.polynomial.polynomial.polypow

numpy.polynomial.polynomial.polypow(c, pow, maxpower=None)[source]

Raise a polynomial to a power.

Returns the polynomial 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 1 + 2*x + 3*x**2.

Parameters
carray_like

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

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

Power series of power.

Examples

>>> from numpy.polynomial import polynomial as P
>>> P.polypow([1,2,3], 2)
array([ 1., 4., 10., 12., 9.])