title: Python rising/falling edge oscilloscope-like trigger
body: <p>I'm trying to detect rising and/or falling edges in a numpy vector, based on a trigger value. This is kinda like how oscilloscope triggering works.</p>
  
  <p>The numpy vector contains floating point values. The trigger itself is a floating point value. I would expect this to work as such:</p>
  
  <pre><code>import numpy as np
  data = np.array([-1, -0.5, 0, 0.5, 1, 1.5, 2])
  trigger = rising_edge(data, 0.3)
  print(trigger)
  
  [3]
  </code></pre>
  
  <p>In other words, it would work like <code>np.where</code>, returning a vector containing the positions where the condition is true.</p>
  
  <p>I know i can simply iterate over the vector and get the same result (which is what i'm doing), but it isn't ideal, as you can imagine. Is there some functionality built into numpy that can do this using optimized C code? Or maybe in some other library?</p>
  
  <p>Thank you.</p>