import numpy as np from scipy.signal import find_peaks signal = np.array([0.0, 1.2, 0.1, 0.8, 0.2, 3.1, 0.4, 0.7, 0.2, 2.5, 0.1]) peaks, properties = find_peaks( signal, height=1.0, distance=3, prominence=1.0, width=(None, None), ) print("peak indexes:", peaks.tolist()) print("peak values:", signal[peaks].round(2).tolist()) print("prominences:", properties["prominences"].round(2).tolist()) print("widths:", properties["widths"].round(2).tolist()) print("expected match:", np.array_equal(peaks, np.array([1, 5, 9])))