You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may be a 'historical reasons' issue, but it looks like numpy.polynomial.polynomial.polyfit and numpy.polyfit return coefficients in reverse order from each other. I wonder if one of the functions should be deprecated from the public API in future, as having two functions with the same name in the same package that operate differently can lead to confusion?
Reproducing code example:
importnumpyasnpfromnumpy.polynomial.polynomialimportpolyfitx=np.linspace(0, 1, 100)
y=x**3p1=np.polyfit(x, y, 3)
p2=polyfit(x, y, 3)
print('p1', p1)
print('p2', p2)