Ask Your Question

Revision history [back]

How about converting f.diff(z) into a string, then stripping off the pieces you don't need? For instance,

s = str(f.diff(z)).split("(")[-1][:-1].split(",")

yields the list s = ['z', ' t']. Or if you want a list of symbolic variables, map(SR, s) = [z, t]. Ugly, but it might do what you need.

click to hide/show revision 2
Fixed stupid oversight.

How about converting f.diff(z) f into a string, then stripping off the pieces you don't need? For instance,

s = str(f.diff(z)).split("(")[-1][:-1].split(",")str(f).split("(")[-1][:-1].split(",")

yields the list s = ['z', ' t']. Or if you want a list of symbolic variables, map(SR, s) = [z, t]. Ugly, but it might do what you need.