且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将高斯曲线拟合到python中的数据

更新时间:2022-03-17 03:49:34

可能在curve_fit中使用不同数量的参数调用了您的回调. 看看文档上面写着:

Probably your callback is called in curve_fit with a different number of parameters. Have a look at the documentation where it says:

模型函数f(x,...).它必须采用自变量 作为第一个参数,参数适合作为单独的剩余参数 争论.

The model function, f(x, ...). It must take the independent variable as the first argument and the parameters to fit as separate remaining arguments.

为确保能解决此问题,您可能希望在第一个参数之后输入*args并查看获得的结果.

To make sure this works out you might want to take *args after the first argument and have a look at what you get.