Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python scipy find_peaks return empty

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading