I would like to know if there is any way in python to automatically determine the values of point a and b marked in the graph below. Said a different way, finding the values when my plot shows a marked decrease or after a marked increase.
This is the source code of my plot if it is helpful:
#load data
min_duration = data['Time_Secondes'].min()
max_duration = data['Time_Secondes'].max()
xr_ = list(range(min_duration, max_duration, 60))
y_ = []
for i in range(0,(len(xr_)-1)):
Time_proba_ = np.logical_and(data['Time_Secondes'].values >= xr_[i], data['Time_Secondes'].values < xr_[i+1])
Time_proba_1_ = np.logical_and(np.logical_and(data['Time_Secondes'].values >= xr_[i], data['Time_Secondes'].values < xr_[i+1]), data['outcome'].values==1)
y_.append(sum(Time_proba_1_ )/sum(Time_proba_))
import matplotlib
matplotlib.pyplot.plot(xr_[1:len(xr_)], y_)
```