In sympy there's a method call as_coeffficients_dict() that returns all
the terms and their coefficients from an expression. I am if I can do
something like this in Sage. For examples
>>> (3*x + a*x + 4).as_coefficients_dict()
{1: 4, x: 3, a*x: 1}
>>> (3*a*x).as_coefficients_dict()
{a*x: 3}
>>> (x-oo).as_coefficients_dict() #can also deal with infinity
{1: -oo, x: 1}
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.