Home > Blockchain >  Python scipy find_peaks return empty
Python scipy find_peaks return empty

Time:08-25

I try to find peaks of below array using the scipy find_peaks function.

Array = np.array([84.6345, 84.643, 84.6375, 84.568, 84.524, 84.5345, 84.5305, 84.548, 84.562, 84.6295, 84.668, 84.5795, 84.565, 84.5715])
peaks = find_peaks(Array)

But I got returned result with empty peak as below.

(array([ 1,  5, 10], dtype=int64), {})

Any advice or guidance on this would be greatly appreciated, Thanks.

CodePudding user response:

Your peaks are at elements 1, 5, and 10. What are you looking for? Do you want the actual values? That would be Array[peaks[0]].

The second return value only contains entries for specific argument combinations.

https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html

  • Related