er schmeißt mir den Fehler:
Traceback (most recent call last):
File "..." line 30, in <module>
plt.plot(x_d, exponential(x_d, pars[0], pars[1]), linestyle='--', linewidth=2, color='black')
File "...", line 9, in exponential
return a*np.exp(b*x)
TypeError: can't multiply sequence by non-int of type 'numpy.float64'
Code: Alles auswählen
def exponential(x, a, b):
return a*np.exp(b*x)
pars, cov = curve_fit(f=exponential, xdata=x_d, ydata=y, p0=[0.1, 0.1], maxfev=1000)
plt.plot(x_d, exponential(x_d, pars[0], pars[1]), linestyle='--', linewidth=2, color='black')