def get_local_minima(x, y):
"""
This function ...
:param x:
:param y:
:return:
"""
m = argrelextrema(y, np.less)[0].tolist()
# Find the indx of the absolute minimum (should also be included, is not for example when it is at the edge)
index = np.argmin(y)
if index not in m: m.append(index)
x_minima = [x[i] for i in m]
y_minima = [y[i] for i in m]
return x_minima, y_minima
# -----------------------------------------------------------------
评论列表
文章目录