I would prefer using what is already implemented in the poly module. This means that you must transform your expression into a polynomial:
In [2]: a = Poly(1+x**2+y) In [6]: a.gens # the generators of the polynomial Out[6]: (x, y) In [3]: a.monoms() # the powers of each generator in each monomial Out[3]: [(2, 0), (0, 1), (0, 0)] In [4]: a.coeffs() # the coefficients in front of each monomial Out[4]: [1, 1, 1] -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
