I am using scipy.optimize.minimize_scalar and got an error:
File "C:\Program Files (x86)\Microsoft Visual
Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_minimize.py",
line 873, in minimize_scalar
return _minimize_scalar_bounded(fun, bounds, args, **options)
File "C:\Program Files (x86)\Microsoft Visual
Studio\Shared\Python39_64\lib\site-packages\scipy\optimize\_optimize.py",
line 2210, in _minimize_scalar_bounded
if np.isnan(xf) or np.isnan(fx) or np.isnan(fu):
TypeError: ufunc 'isnan' not supported for the input types, and the inputs
could not be safely coerced to any supported types according to the casting
rule ''safe''
After changing the return of my objective function from
retVal = abs(q1In - PSq1IC(maxk, x)) to
retVal = float(abs(q1In - PSq1IC(maxk, x)))
things are working well.
My conclusion: scipy.optimize.minimize_scalar can deal with float and
float64, but not Float.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/f0f1766f-4853-4c78-b59e-e1934042d7f4n%40googlegroups.com.