Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

least square fit straight line python

from scipy.optimize import curve_fit

def f(x, A, B): # this is your 'straight line' y=f(x)
    return A*x + B

popt, pcov = curve_fit(f, x, y) # your data x, y to fit
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #square #fit #straight #line #python
ADD COMMENT
Topic
Name
1+6 =