Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. # Finding the min and max
  2. c_max_index = argrelextrema(df.flow.values, np.greater, order=3)
  3. c_min_index = argrelextrema(df.flow.values, np.less, order=3)
  4.  
  5. df['min_extreme'] = df.flow[c_min_index[0]]
  6. df['max_extreme'] = df.flow[c_max_index[0]]
  7.  
  8. # Plotting the values for the graph above
  9. plt.plot(df.flow.values)
  10. upper_bound = plt.plot(c_max_index[0], df.flow.values[c_max_index[0]], linewidth=0.8, c='g')
  11. lower_bound = plt.plot(c_min_index[0], df.flow.values[c_min_index[0]], linewidth=0.8, c='r')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement