0

如何在以下代码中禁止打印“添加参数”

In [7]: from numpy import sqrt, pi, exp, linspace 
In [8]: import numpy as np    
In [9]: def gaussian(x, amp, cen, wid):
   ...:        return amp * exp(-(x-cen)**2 /wid)
   ...: x = linspace(-10,10)
   ...: y = gaussian(x, 2.33, 0.21, 1.51) + np.random.normal(0, 0.2, len(x))
   ...: 

In [10]: from lmfit import Model
In [11]: gmod = Model(gaussian)
In [12]: result = gmod.fit(y, x=x, amp=5, cen=5, wid=1)#<-- here!!
 - Adding parameter "amp"
 - Adding parameter "cen"
 - Adding parameter "wid"

谢谢。

4

1 回答 1

0

为了抑制此输出,需要添加 verbose=False

fit(..., verbose=False)
于 2016-01-17T21:37:46.047 回答