bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / polynomial / _polybase / ABCPolyBase / degree
function
numpy.polynomial._polybase:ABCPolyBase.degree
source: build-install/usr/lib/python3.14/site-packages/numpy/polynomial/_polybase.py :670
Signature
def degree ( self ) Summary
The degree of the series.
Returns
degree: intDegree of the series, one less than the number of coefficients.
Examples
Create a polynomial object for ``1 + 7*x + 4*x**2``:np.polynomial.set_default_printstyle("unicode") poly = np.polynomial.Polynomial([1, 7, 4]) print(poly) poly.degree()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) poly.degree() poly.trim().degree()
Aliases
-
numpy.polynomial._polybase.ABCPolyBase.degree