I have a vector A and I want to find all the "i" values of the array which are bigger than the neighboring values, i.e. right before (i-1) and right after (i+1). I wrote a simple code (surely with mistakes) that should print the array (y_maxtab) containing the "i" values. I try to run and It gets stacked. Could you help me on that?
import numpy as np
y_maxtab = []
A=np.array([2.0,2.5,1.7,5,7,8,9,3,5,3,7,8])
i=1
while i <= len(A):
if A[i] > A[i-1] and a[i] > A[i+1]:
y_maxtab.append(A[i])
i=i+1
print y_maxtab