5

numpy.polynomial.polynomial.Polynomial stores polynomial coefficients in order of increasing degree, while numpy.poly1d stores polynomial coefficients in order of decreasing degree.

Is there a reason for this difference? Is there an advantage to either approach?

4

1 回答 1

8

根据NumPy 上的 SciPy 参考

在 NumPy 1.4 之前,numpy.poly1d 是首选类,它仍然可用以保持向后兼容性。但是,较新的 Polynomial 包比 numpy.poly1d 更完整,并且其便利类在 numpy 环境中表现更好。因此建议将多项式用于新编码。

于 2016-06-24T16:05:53.020 回答