numpy.polynomial.polynomial.Polynomial以递增程度的顺序存储多项式系数,而numpy.poly1d按递减程度的顺序存储多项式系数.
有这种差异的原因吗?两种方法都有优势吗?
解决方法:
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.