编程语言
首页 > 编程语言> > python – 为什么Numpy在按度数排序多项式系数时不一致?

python – 为什么Numpy在按度数排序多项式系数时不一致?

作者:互联网

numpy.polynomial.polynomial.Polynomial以递增程度的顺序存储多项式系数,而numpy.poly1d按递减程度的顺序存储多项式系数.

有这种差异的原因吗?两种方法都有优势吗?

解决方法:

根据SciPy reference on NumPy

Prior to NumPy 1.4, numpy.poly1d was the class of choice and it is still available in order to maintain backward compatibility. However, the newer Polynomial package is more complete than numpy.poly1d and its convenience classes are better behaved in the numpy environment. Therefore Polynomial is recommended for new coding.

标签:python,numpy,scipy,polynomials,coefficients
来源: https://codeday.me/bug/20190527/1166442.html