Created
June 19, 2013 18:01
-
-
Save andrewgiessel/5816412 to your computer and use it in GitHub Desktop.
exponential decay fit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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