Prevent sympy from simplifying python expression after replacement

I use Sympy to substitute a set of expressions for another using the Subs function, and I would like the program to not tidy up or simplify the equations. i if I substituted x+y for a in

a+b+c+a to return x+y+b+c+x+y

Does anyone know how to do this?

Thank you very much

+4
source share
1 answer

The only way to do this is to do Add(x, y, b, c, x, y, evaluate=False) , which, unfortunately, is not very easy to work with.

+7
source

Source: https://habr.com/ru/post/1484433/


All Articles