You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
200 B

from scipy.optimize import curve_fit
def linear_model(x, a, b):
y= a * x + b
return y
x = [0, 1, 2, 3, 4, 5]
y = [15, 10, 9, 6, 2, 0]
popt, pcov = curve_fit(linear_model, x, y)
print(popt)