0
在試圖適應指數數據,scipy.optimize.curve_fit返回類型錯誤scipy.optimize.curve_fit類型錯誤
x = np.array([0.,1200.02220551,3600.06661654,6000.11102756,8400.15543858,10800.19984961])
y = np.array([0.51057636,0.63187347,0.72030091,0.75168574,0.79036657,0.81551974])
def f(x,p1,p2):
p1*np.exp(x*p2)
popt, pcov = curve_fit(f, x, y)
不幸的是這將返回以下錯誤:
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
的任何建議這裏出了什麼問題將不勝感激。