Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The syntax ex.substitute(a=b, c=d) is read by binding the a and c identifiers to b and d respectively in a list of keyword arguments passed to the body of the subs method. This is possible if and only if a and c are acceptable python identifiers. Something like q12^2 is not.

Using either ex.subs([a==b, c==d]) or ex.subs({a:b, c:d}) syntaxes do not have this limitation ; BTW, the latter is the only one accepted by sympy ; standardizing on it might be a good idea.

HTH,