TypeError: unsupported operand type(s) for /: 'float' and 'Bicomplex'
bacalfa opened this issue · 3 comments
bacalfa commented
The following gives an error:
import numpy as np
import numdifftools as nd
g = lambda x: 1.0/(np.exp(x[0]) + np.cos(x[1]) + 10)
print(nd.Gradient(g, method="multicomplex")([1.0, 2.0]))
If I change the method to "complex"
, it works fine. Is there a way to use the multicomplex method in this situation and other similar ones?
pbrod commented
I don't get this error:
Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct 15 2017, 03:34:40) [MSC v.1500 64 bit (AMD64)]
In [10]: nd.Gradient(g, method="multicomplex")([1.0, 2.0])
Out[10]: array([-0.01796112, 0.00600821])
What version of numdifftools and python are you using?
bacalfa commented
I'm on Windows 7 64-bit.
Python 3.6.5 :: Anaconda custom (64-bit)
numdifftools=0.9.20=py_0