Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
exponential decay fit
from scipy.optimize import curve_fit
def exponential(t, A, tau, C):
return A * np.exp(-tau * t) + C
start = None # redefine
ydata = data[start:]
xdata = np.arange(ydata.shape[0])
popt, pcov = curve_fit(exponential, xdata, ydata, p0=(1.0, 1, 0]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment