-3

slow growing peak

How can we find the sudden peak around index marked as yellow using pandas, I have seen an answer for sudden drops,(How to detect a sudden change in a time series plot in Pandas) but i cannot i achieve the sudden peak (yellow point in graph) and slowly growing trend in timeseries in rolling window fashion if there is a slow growing peak again, how can we detect all points like this in a rolling fashion

sr227
  • 1
  • 4

1 Answers1

0

you can use diff() and the docs are hier

n = 0
m = 1
df.loc[df['velocity'].diff(m)>n]

n shows the increase of the value, when n positive is. m is the period. For user defined changes in the value the both values n and m have to be adjusted, because the data is not available at the time.

coco18
  • 836
  • 8
  • 18
  • no, this doesn't give an exact point where there is a sudden change, the point around index 160 is the point where the graph started increasing – sr227 Mar 04 '20 at 09:14