Collect: order of terms

38 views
Skip to first unread message

Thomas Ligon

unread,
May 5, 2021, 3:59:18 AM5/5/21
to sympy
In this task, I am analyzing partial sums of power series. At one place, I call
exp = collect(expand(exp), m, factor)
The expression exp is a partial sum of a power series in powers of m. After this call, I have one more manipulation and then I print the results.
For the printout, I would like to see the power series in ascending powers of m
1-2m/3+7m**2/18
but collect returns descending powers
7m**2/18-2m/3+1
I was hoping I could call collect and pass a parameter for the order of the output, but didn't find anything.
Does anyone have a recommendation?

Chris Smith

unread,
May 5, 2021, 7:58:56 AM5/5/21
to sympy

Thomas Ligon

unread,
May 6, 2021, 4:27:30 PM5/6/21
to sympy
Thanks for the tip.
Reply all
Reply to author
Forward
0 new messages