Numpy provides a feature to fit functions. This is quite useful to fit your data to a model. The attached notebook demonstrates how to use the numpy fitting algorithm.