I walk through how to fit custom trendlines, like a sine function or exponential model, in Python using the curve_fit method of the scipy package. Source code: https://github.com/vastevenson/fit-custom-sine-fn-py-vs
Credit: Vasco on https://stackoverflow.com/questions/16716302/how-do-i-fit-a-sine-curve-to-my-data-with-pylab-and-numpy