I'm trying to learn how to use scipy.optimize.minimize. I'm going to need it for functions of two variables with around a thousand terms each; so I came up with an easy example first:
from scipy.optimize import minimize
def test_function(x,y):
return x*(x-1)+y*(y-1)
mins=minimize(test_function,x0=(0,0),bounds=[(0,1),(0,1)])
So I expect an answer of x=0.5, y=0.5.
Unfortunately, I instead get the following error:
TypeError: test_function() missing 1 required positional argument: 'y'
What does it mean by my test function missing a positional argument?