pydata / numexpr

Fast numerical array expression evaluator for Python, NumPy, Pandas, PyTables and more
https://numexpr.readthedocs.io/en/latest/user_guide.html
MIT License
2.21k stars 207 forks source link

Forbidden Control Character Error for imaginary element #459

Closed skuschel closed 9 months ago

skuschel commented 9 months ago

I believe that https://github.com/pydata/numexpr/commit/397cc98359301d0e7b96aaa6d3c79419d1d4f189 introduced a bug or at least it changed the behavior:

I used to do something like this, of course with x being a large array:

import numexpr as ne
x = 5
y = ne.evaluate('exp(1.j*x)')

As of the mentioned change, this gives me an "Expression has forbidden control character" error. It works with ints e.g 'exp(1j*x)', but 'exp(1.5j*x)' is also raising the error.

FrancescAlted commented 9 months ago

Fixed by #462