Re: [sympy] Re: Is this a bug?

2024-07-09 Thread Oscar Benjamin
Ideally series would produce something more like a Poly object rather than just an Add with an O() term. You can use Poly to get the coefficients in order: In [6]: sin(x).series(x,0,10).removeO().as_poly(x).coeffs()[::-1] Out[6]: [1, -1/6, 1/120, -1/5040, 1/362880] In [7]: sin(x).series(x,0,10).r

[sympy] Re: Is this a bug?

2024-07-09 Thread Chengpu Wang
How do I detect which order of x? On Tuesday, July 9, 2024 at 5:41:50 AM UTC-4 emanuel.c...@gmail.com wrote: > Doesn't matter : > > ``` > >>> from sympy import * > >>> x=symbols("x") > >>> sin(x).series(x,0,10).args > (x, -x**3/6, -x**7/5040, x**5/120, x**9/362880, O(x**10)) > ``` > > The argumen

[sympy] Re: Is this a bug?

2024-07-09 Thread emanuel.c...@gmail.com
Doesn't matter : ``` >>> from sympy import * >>> x=symbols("x") >>> sin(x).series(x,0,10).args (x, -x**3/6, -x**7/5040, x**5/120, x**9/362880, O(x**10)) ``` The arguments tuple doesn't order `x` powers (and this isn't a problem, since (complex) multiplication is commutative. But ``` >>> sin(x).