Python Nonlinear Least Squares