numpy.polynomial.laguerre.Laguerre.degree#

method

polynomial.laguerre.Laguerre.degree()[源代码]#

级数的次数.

返回:
阶数int

序列的阶数,比系数的数量少 1.

示例

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

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

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

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