curve fitting with python

*爱你&永不变心* 提交于 2019-12-19 05:14:33

问题


I'm trying to fit some data and stuff, I know there is a simple command to do this with python/numpy/matplotlib, but I can't find it. I think it is something like

popt,popc = numpy.curvefit(f,x)

where popt is the paramters of f, popc is the fit quality and f is a predefined function of f. Does any of you know it?


回答1:


Take a look at scipy.optimize.curve_fit:

scipy.optimize.curve_fit(f, xdata, ydata, p0=None, sigma=None, **kw)

Use non-linear least squares to fit a function, f, to data.




回答2:


Found it. Curve_fit from optimize in scipy



来源:https://stackoverflow.com/questions/8280871/curve-fitting-with-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!