Reputation:
I want to perform a linear approximation and get the linear equation of my data from the array of data in python. I was thinking about using:
np.polyfit(x,y,1).
But the problem is that my equation is
y=ax+b, b=0
So I need to calculate only parameter a. Can you suggest something?
Upvotes: 0
Views: 775
Reputation: 3401
What you are looking for called Linear Regression
, take a look at this link for more description.
Upvotes: 1