Calling the Powell minimizer for a single-dimensional problem is creating an OptimizeResult
with an inaccessible value. For example:
from scipy.optimize import minimize
test = minimize(lambda x: 1.0, np.array([1.0]), method="Powell")
If I then ask for test.x
I get:
array(3.58792896)
Something is wrong with that "array": I can't get the value out of it. For example, test.x[0]
returns IndexError: too many indices for array
. It's like it's a zero-dimensional array, or there's some other reference problem.
(A well-formed ndarray
would display like array([3.58792896])
.)
What am I doing wrong?