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, ])