Hello everyone. I have another question, and as topic name says: how can I 
sort return of solve, so complex numbers wont be in anymore?

I've seached in flags for it, but no luck, and then I've played with .is_* 
attributes and got something wierd(?):

sols = solve(x**3 - 4)
sols = [sol for sol in sols if sol.is_complex]

sols before filtering:
[2**(2/3), -2**(2/3)/2 - 2**(2/3)*sqrt(3)*I/2, -2**(2/3)/2 + 
2**(2/3)*sqrt(3)*I/2]

after:
2**(2/3)

Question is why and does that code always gives me what I want? (Just 
confused about why is_complex returns True for real, and False for exactly 
complex number).

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to