Hi,
>>> import sympy as sp
>>> w, x, y, z = sp.symbols("w x y z")
>>> sp.factor(w*x + w*y + z)
w*x + w*y + z
I would obviously want w*(x+y) + z
Without the "+ z" part it works as expected:
>>> sp.factor(w*x + w*y)
w*(x + y)
I tried several thing, like using deep=True argument, or even hinting by
providing the answer:
>>> sp.factor(w*x + w*y + z, deep=True)
w*x + w*y + z
>>> sp.factor(w*(x + y) + z)
w*x + w*y + z
Strangely, if I mix both it suddenly works:
>>> sp.factor(w*(x + y) + z, deep=True)
w*(x + y) + z
But this obviously doesn't help me.
I considered parsing my expression myself at this point, but I'd really
love to
avoid doing this...
Regards,
--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/d59be48c-a760-4e95-9188-1890d0e6dda6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.