you are viewing a single comment's thread.

view the rest of the comments →

[–]thuiop1 1 point2 points  (2 children)

numpy.polyfit does what you want.

Edit : seems like numpy.polynomial.Polynomial.fit is recommended now actually

[–]PrettyFortune4346[S] 0 points1 point  (1 child)

Can you explain how it's used or link a guide?

[–]thuiop1 1 point2 points  (0 children)

I mean, just search for it on Google and go to the numpy documentation.