I have a list of points where I need to find peak points and group them. I am using find_peak() function from scipy.signal to find the peak points, Now I need to group the peak points which correspond to the same hill (as mentioned below). How can we do this, any suggestion would be of great help.
Code
from matplotlib import pyplot as plt
from scipy.signal import find_peaks
# lst has list of points
A = np.array(lst)
peaks, _ = find_peaks(A)
plt.figure()
plt.plot(lst)
plt.plot(peaks, A[peaks], "ro")
plt.grid()
plt.show()

