A fit to counts made with a known rate. What does this print? import numpy as np; from scipy.optimize import curve_fit; t = np.array([0, 1, 2, 3]); N = 60 * np.exp(0.7 * t); (n0, r), cov = curve_fit(lambda t, n0, r: n0 * np.exp(r * t), t, N, p0=[50, 0.5]); print(round(r, 2))
Log in to join the discussion.
Loading…