0

Here's what I have so far:

locs = np.where((v_1 >= 1.9) & (v_1 <= 2.00))

I just want to add the condition that the next element (after the one where v_1 meets the current conditions) is larger than the found element.

Thanks in advance!

Robbie Capps
  • 417
  • 1
  • 5
  • 16

1 Answers1

0

Well, I solved it myself!

(see Finding local maxima/minima with Numpy in a 1D numpy array )

locs = (np.diff(np.sign(np.diff(v_1))) < 0).nonzero()[0] +1
Community
  • 1
  • 1
Robbie Capps
  • 417
  • 1
  • 5
  • 16