Updates:
        Status: Started
        Labels: NeedsReview

Comment #7 on issue 2155 by asmeurer: lambdify() does not convert complex quantities properly with the "numpy" option
http://code.google.com/p/sympy/issues/detail?id=2155

See https://github.com/sympy/sympy/pull/479.

Note that there didn't seem to be a precedent for testing numpy functionality in lambdify(), so I didn't add any test for the I => 1j in numpy fix. If people want, I can add a test for it.

It does work now, though:

In [1]: import numpy as np

In [2]: import sympy

In [3]:

In [4]: x = sympy.var('x')

In [5]: y = x**2 + sympy.I*2

In [6]: y_func = sympy.lambdify((x), y, "numpy")

In [7]: a = np.arange(10)

In [8]: res = y_func(a)

In [9]: res
Out[9]:
[  0.+2.j   1.+2.j   4.+2.j   9.+2.j  16.+2.j  25.+2.j  36.+2.j  49.+2.j
                            64.+2.j  81.+2.j]


--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to