SHARE
TWEET

Untitled

a guest Jun 16th, 2019 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top