Skip to content

numpy.polynomial.polynomial.polyfit and numpy.polyfit return coefficients in different order #7478

@ckrapu

Description

@ckrapu

Hi,

This is my first issue so I apologize if I have gotten something obviously wrong. Essentially, it appears that when using the polyfit function from numpy.polynomial.polynomial, the coefficients are returned with lowest order first; this is the opposite of what happens when the function numpy.polyfit is called. I believe that the documentation for both functions states that the highest order coefficient should be returned first. As an example, I've attached a screenshot of an IPython notebook with a minimal example along with the code. My version of numpy is 1.10.4 and I am on Debian 3.16.0-4.

from numpy.polynomial.polynomial import polyfit 
import numpy as np                            
print np.version.version
print np.polyfit([1,2],[2,4],1)
print polyfit([1,2],[2,4],1)

numpy_polynomial_bug

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions