Python Minimize Least Square