I have a function which takes several arguments (one array and two floats) and returns a scalar (float). Now I want to minimize this function by varying two of the arguments: the two floats. The array is "unpacked" inside the function at its contents (arrays and floats) are then used.
How can this be done using SciPy's fmin function? I am having a very hard time figuring out the right syntax for this..
The function is something like:
def func(x, y, data)
data1=data[0]
data2=data[...]
...
...
result = ...x...y...data1...data2... #result is a scalar (float)
return result
What should scipy.optimize.fmin
look like in this case?
optimize.fmin(func, ???)
Many thanks in advance!
All the best, p.p.