What I tried: I tried using liner regression and finding slope and intercept etc. But it gives only a straight line. does not indicate trend and then change in trend and again continuation of trend. What I want: I have series 1,2,4,5,7,9,8,6,4,3,5,7,8. I want to find when the numbers are in ascending and when they start descending and again ascending using python. The expectation is that I should get following ascending 1,2,4,5,7,9 descending 9,8,6,4,3 and then ascending again 3,5,7,8 Continue reading...