Skip to content

Instantly share code, notes, and snippets.

@andrewgiessel
Created June 19, 2013 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewgiessel/5816412 to your computer and use it in GitHub Desktop.
Save andrewgiessel/5816412 to your computer and use it in GitHub Desktop.
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