


> 388 shape, dtype = _check_func('leastsq', 'func', func, x0, args, n) ~\anaconda3\lib\site-packages\scipy\optimize\minpack.py in leastsq(func, x0, args, Dfun, full_output, col_deriv, ftol, xtol, gtol, maxfev, epsfcn, factor, diag) > 763 res = leastsq(func, p0, Dfun=jac, full_output=1, **kwargs)ħ64 popt, pcov, infodict, errmsg, ier = res

~\anaconda3\lib\site-packages\scipy\optimize\minpack.py in curve_fit(f, xdata, ydata, p0, sigma, absolute_sigma, check_finite, bounds, method, jac, **kwargs)ħ61 # Remove full_output from kwargs, otherwise we're passing it in twice.ħ62 return_full = kwargs.pop('full_output', False) > 35 parameters, covariance = _fit(Srt, xdata, ydata) Inde圎rror Traceback (most recent call last) S T What do I have to change in my code so that I can work with my function Srt and curve_fit ? If I understand the error message correctly, for some reason, the array ydata is not an array anymore when it is read in as s ?!? When I continue to use curve_fit to make the fit for Vmax and Km with: parameters, covariance = _fit(Srt, xdata, ydata) If I do not use np.asarray, I get a "Type Error": Srt(x, y,10,10) S0 = s # Substrate concentration at time = 0 (beginning of reaction)Į = np.exp(((Smax - s0) - Vmax*(t+t0))/Km) Smax = s # Substrate concentration at end of reaction Reading the data and defining the function, using dummy values (10,10) for Km and Vmax (which are to be determined using the curve fit) works fine, as long as I use np.asarray(): from scipy.special import lambertw I am trying to fit some experimental data (x and y) with a custom function (Srt) and using _fit():
