When I try to minimize a function with scipy.minimize.brute() using the following code:
import scipy
scipy.optimize.brute(lambda x: x**2, ranges=(-2,3))
I get the following error:
TypeError: object of type 'int' has no len()
I suppose it has to do with the specification of the range, but I don't see why. The documentation says
Each component of the ranges tuple must be either a “slice object” or a range tuple of the form (low, high).
Where is my mistake?