【发布时间】:2017-02-11 13:00:38
【问题描述】:
我想为包含 12 个月数据的数据集绘制时间序列。但是,数据会在 12 个月内每天每小时记录一次。整个数据集有超过 8000 个数据点。数据格式如下
Date Time Energy
0 2014-01-01 1 1118.1
1 2014-01-01 2 1233.2
2 2014-01-01 3 1278.2
. . . .
23 2014-01-01 24 1125.3
24 2014-01-02 1 1213.3
. . . .
当我这样绘制时
plt.plot(energy['Date'], energy['Energy'])
plt.xlabel('Date')
plt.ylabel('Energy')
这个图表没有多大意义,因为我无法观察到任何趋势。相反,我想绘制每天的平均能量。欢迎任何其他关于如何以我观察到任何趋势的方式绘制这个时间序列的建议
【问题讨论】:
-
8000多?! giphy.com/gifs/wander-over-yonder-Mra7xZQpHxNC 现在我正在处理一个相对较小的数据集,它有 2,747,418*2 个点。
标签: python python-3.x pandas matplotlib