fun = lambda x: (x[0] - 1) ** 2 + (x[1] - 2.5) ** 2
res = optimize.minimize(fun, (2, 0), method='TNC', tol=1e-10)
print(res.x)
bnds = (0.25, 0.75), (0, 2.0)
res = optimize.minimize(fun, (2, 0), method='TNC', bounds=bnds, tol=1e-10)
Scipy.optimize: how to restrict argument values