为什么 Numpy 在按度排序多项式系数时不一致?
Why is Numpy inconsistent in ordering polynomial coefficients by degree?
numpy.polynomial.polynomial.Polynomial stores polynomial coefficients in order of increasing degree, while 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.
numpy.polynomial.polynomial.Polynomial stores polynomial coefficients in order of increasing degree, while 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.