I think you're looking for argrelmax , from scipy.signal . It gives you the relative maximum indices of the 1d array.
from scipy.signal import argrelmax t=linspace(-4,40,1000) y=sin(t) argrelmax(y)[0]
with the result
[126 269 412 554 697 840 982]
to get the values โโuse
y[argrelmax(y)[0]]
EDIT:
note that it does not take into account local maxima at the extremes of your domain.
gg349 source share