Home > other >  [for] about module scipy curve_fit function in usage
[for] about module scipy curve_fit function in usage

Time:09-16

For curv_fit (), I use the following code when normal
 
Def func (x, a, b) :
Return a * np. J exp (b * x)

But using
 
Def func (x, a, b) :
Return a * np. The log (b * x, 10)

Can not run normally, throw an error: the File "... ", line 11, in func
Return a * np. The log (b * x, 10)
TypeError: return arrays must be of ArrayType

For help

CodePudding user response:

You should use the wrong, the logarithmic function usage,
If you want to use 10 logarithmic should is np. The log10 (x) (x) can be a vector
Np. The log (x), is ln in mathematics, e logarithm,

If you want to use any logs base, numpy bag, there is no direct parameters can be used in bottom formula to express,
Have direct formula is math packet, math you can use the usage, you should take these two functions is confused,
  • Related