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
Asked
Active
Viewed 1,007 times
-3
-
1I would use the sudden drop answer and put a minus sign in front of you data XD XD – Andrea Mar 04 '20 at 08:16
-
thank you, but i didn't get minus in front of data means? – sr227 Mar 04 '20 at 08:30
-
Well, if you want to find a peak in your array `data_y`, it is the same as looking for a drop in `-data_y` :) – Andrea Mar 04 '20 at 08:36
-
can you give us some date to work with? – coco18 Mar 04 '20 at 08:36
-
Can you please define, what is sudden peak with you as well? – coco18 Mar 04 '20 at 08:37
-
dec 10 20:20 .12107 dec 10 20:30 .121237 dec 10 20:40 .123112 dec 10 21:30 .12467 dec 10 21:40 .1310 dec 10 21:50 .1350 – sr227 Mar 04 '20 at 08:38
-
The yellow point in the graph, slowing growing overtime – sr227 Mar 04 '20 at 08:42
-
looking for drop in -data_y didnt help – sr227 Mar 04 '20 at 08:47
-
@coco18 you could use the same data as in https://stackoverflow.com/questions/54048291/how-to-detect-a-sudden-change-in-a-time-series-plot-in-pandas i want to detect the change in graph around the index 160 – sr227 Mar 04 '20 at 08:49
1 Answers
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