Dear group,

A substitution like this is easy to make with SymPy:

(a*x**2+b*x+c).subs(x,y)

However, how can I make a conditional substitution, such as:

a) One that would replace even powers of x only.

b) One which would replace even powers of x by y**(n/2) resulting in a*y**7+b*x+c? I.e. one where parts of the object being replaced would be available to form part of the result - thus x**14 would contribute '7' to the resultant expression.

Thanks in anticipation!

David

--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/f4c4ab4c-d84f-cd9b-1e6d-0e0260804c1d%40dbailey.co.uk.

Reply via email to