【发布时间】:2017-10-29 21:54:00
【问题描述】:
当我尝试运行时:
bet = (nu[minimum],10**4,3000,0,0,5000) # Array of initial bet parameters
bound = ( (nu[0],nu[len(nu)-1]),(10**3,10**6),(-np.inf,np.inf),(-np.inf,np.inf),(-np.inf,np.inf),(-np.inf,np.inf) )
popt,pcov = curve_fit(S_21,x,y, p0=bet, bounds = bound)
TypeError: leastsq() 得到了一个意外的关键字参数 'bounds'
有什么问题?我在 Windows 上使用 Python 3.4.4。
【问题讨论】:
-
bounds参数是在 scipy 版本 0.17 中添加的。您使用的是哪个版本?检查import scipy; print(scipy.__version__)。
标签: python python-3.x scipy curve-fitting bounds