我使用peakutils
Python
包来检测数据中的峰值(第二列estimated.csv
-foundhere(单击链接)。在
以下是我查找峰值的代码:
#/usr/bin/python -tt
import pandas as pd
import peakutils
estimated_data = pd.read_csv("estimated.csv", header=None)
col2 = estimated_data[:][1] # Second column data
print(col2[:]) # Print all the rows
index = peakutils.indexes(col2, thres=0.4, min_dist=1000)
print(index)
峰值检测工作得非常好。我想在下面的教程中绘制所有检测到的峰值。在
https://plot.ly/python/peak-finding/
但是看起来plotly
在离线状态下似乎不起作用。使用Python
包(如matplotlib
)有不同的方法吗?在
使用matplotlib绘制峰值可以通过使用带标记的绘图来完成。通过peakutils函数找到的索引对数据进行索引。在
为了将峰值与一条线连接起来(如注释中所要求的),on将简单地省略
^{pr2}$ls=""
相关问题 更多 >
编程相关推荐