Dear All,

I was hoping to use SymPy patterns to perform a transformation equivalent to this Mathematica code:

f[a + 2*b + c] /. f[x_] -> g[x]

      g[a + 2 b + c]

I.e. I wanted to replace calls to the (undefined) function f with calls to the function g with the same arguments.

I tried the following, with f and g set up as undefined functions:

patt=Wild("p1")

f(a+2*b+c).subs(f(patt),g(patt))

     f(a + 2*b + c)

Is there a way to do this?

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/87d22d50-3fd2-101e-7dc2-ad90843b06ca%40dbailey.co.uk.

Reply via email to