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.

上一篇:PAT Advanced 1009 Product of Polynomials


下一篇:信息论