📅  最后修改于: 2022-03-11 14:45:33.344000             🧑  作者: Mango
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