numpy.polynomial.chebyshev.Chebyshev . Degree #

方法

多项式.chebyshev.切比雪夫。( ) [来源] #

系列的程度。

1.5.0 版本中的新增内容。

返回
度数

级数的次数,比系数的数量减一。

例子

创建一个多项式对象:1 + 7*x + 4*x**2

>>> poly = np.polynomial.Polynomial([1, 7, 4])
>>> print(poly)
1.0 + 7.0·x + 4.0·x²
>>> poly.degree()
2

请注意,此方法不检查非零系数。您必须修剪多项式以删除任何尾随零:

>>> poly = np.polynomial.Polynomial([1, 7, 0])
>>> print(poly)
1.0 + 7.0·x + 0.0·x²
>>> poly.degree()
2
>>> poly.trim().degree()
1