【发布时间】:2017-11-14 02:52:44
【问题描述】:
我正在使用 peakutils Python 包来检测我的数据中的峰值(estimated.csv 的第二列 - 找到 here(点击链接)。
这是我找到峰值的代码:
#/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 是否有不同的方法?
【问题讨论】:
-
我想你知道请求图书馆是题外话?!如果您想询问有关 plot.ly 的问题,请先阅读 this question 然后改写您的问题。如果您想询问有关仅使用 matplotlib 进行绘图的问题,请改写您的问题以询问您使用 matplotlib 时遇到的问题。决定一种特定的方式。如果您想同时探索这两种方式,请提出两个不同的问题。
-
我今天早上确实看到了这个问题,但对我的帮助不大。我会考虑使用
matplotlib。 -
正如我所说,您应该改写问题以专门询问有关 matplotlib 的问题,然后删除 plotly 错误消息。
-
好的,完成了!
标签: python python-3.x pandas matplotlib plotly