On Wed, Nov 28, 2012 at 12:22 AM, Chris Smith <[email protected]> wrote:
>>
>> If you are just working with polynomials, the easiest way is to use
>> the Poly class, and use the all_coeffs method.  I forget what the best
>> way otherwise is.  You can use .coeff, but it doesn't generalize to
>> getting the constant term from more than one variable.  as_independent
>> does it, but that only works correctly if the expression is an Add.
>>
>
> What do you mean in this case, Aaron?

In [73]: x.as_independent(x)
Out[73]: (1, x)

If you want the constant term, 0, then this is the wrong method.

Aaron Meurer

>
> --
> 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.

-- 
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.

Reply via email to