it's only fitting
Here's a quick-n-dirty Gaussian curve fitter, which I seem to reinvent about twice a year. There are a number of canned solutions that I can never remember how to use, but I also frequently find myself wanting to fit weird functions.
Below in a minimum working example. But the short-short version is
def func(x, *params): ... x,y = read_some_data() guess_params = [...] from scipy import optimize better_params, covariance = optimize.curve_fit( func, x, y, p0=guess_params)