Usually people use `scipy.signal` to detect peak in signal.
>>> scipy.signal.find_peaks_cwt( vec )
which returns list of index where vec is maximum. However this does not work all
the time especially when you want to compute the modality of a distribution.
This is the most sophisticated library (AFAIK):
https://gist.github.com/sixtenbe/1178136
Its can be installed via pip:
$ pip install analytic_wfm
To use,
>>> import analytic_wfm
>>> vec # this is the 1d array in which I want to detect peaks.
>>> maxPeaks, minPeaks = analytic_wfm.peakdetect( vec, lookahead = 10 )
This returns maximum peaks and minimum peaks. There are various other functions
described in readme.txt file.
Dilawar