I use curve_fit to fit a very simple line as below code:
from scipy.optimize import curve_fit
def func(x, a, b):
return a * x + b
x = [6.6000000000000005, 7.599]
y = [123.9835274456227, 144.9319749893788]
popt, pcov = curve_fit(func,x,y,method='dogbox',p0=[20,-15])
print(popt) # get [ 20.96941696 -14.4146245 ]
print(pcov) # get [[inf inf], [inf inf]]
But the pcov result is inf. How can I get correct pcov values ?