Skip to content

Instantly share code, notes, and snippets.

Created Dec 12, 2018
What would you like to do?
Fit all the Gaussians
from scipy import optimize
gauss = lambda x,p: p[0]*exp(-(x-p[1])**2/(2*p[2]**2)) + p[3]
gaussfit = lambda x,y,p0: optimize.leastsq(lambda p, x, y: gauss(x, p) - y, p0, args=(x, y))[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment