Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 stores polynomial coefficients in order of decreasing degree.

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

like image 245
rlchqrd Avatar asked Jun 24 '16 15:06

rlchqrd


1 Answers

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.

like image 189
obataku Avatar answered Sep 29 '22 15:09

obataku