I want to minimize 2-dimenshional function and have such Python code:
def f(x,y):
return (x-1.0)**2 + (y-2.0)**2
res = minimize(f, x0 = [0.0,0.0], bounds = ((-5,5),(-5,5)), method = 'L-BFGS-B')
And it doesn't work, because of such error (this is the last line of the error):
TypeError: f() missing 1 required positional argument: 'y'
What does it mean and how can I fix it?