numpy.polynomial.hermite.Hermite.degree
method
- polynomial.hermite.Hermite.degree()
The degree of the series.
- Returns:
- degree : int
Degree of the series, one less than the number of coefficients.
Examples
Create a polynomial object for
1 + 7*x:
method
The degree of the series.
Degree of the series, one less than the number of coefficients.
Create a polynomial object for 1 + 7*x :
>>> np.polynomial.set_default_printstyle("unicode")
>>> poly = np.polynomial.Polynomial([1, 7, 4])
>>> print(poly)
1.0 + 7.0·x + 4.0·x²
>>> poly.degree()
2
Note that this method does not check for non-zero coefficients. You must trim the polynomial to remove any trailing zeroes:
>>> poly = np.polynomial.Polynomial([1, 7, 0])
>>> print(poly)
1.0 + 7.0·x + 0.0·x²
>>> poly.degree()
2
>>> poly.trim().degree()
1