Hello, On Sun, Jun 10, 2012 at 5:36 AM, Tll Krmn <[email protected]> wrote: > > I wonder in Sympy, is it possible to isolate the complex numbers for > the solution set produced for my problem and only show real numbers > which are greater than 0? I actually need the real number part of the > solution.
Since your solution only contains numbers, this is going to work for you: In [19]: sols = [-1, 2, 3 + 4*I, 5 + 6*I] In [23]: filter(lambda x: (im(x) == 0) and (x > 0), sols) Out[23]: [2] In plain words, you only take those elements of the solution, which have zero imaginary part and are greater than 0. That's not necessarily going to work if the list has more complicated components. Sergiu -- You received this message because you are subscribed to the Google Groups "sympy" 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?hl=en.
