Reputation: 541
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?
Upvotes: 5
Views: 747
Reputation: 29646
According to the 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.
Upvotes: 8