我有一个熊猫系列的时间戳索引,我想绘制。在
print example.head()
2015-08-11 20:07:00-05:00 26
2015-08-11 20:08:00-05:00 66
2015-08-11 20:09:00-05:00 71
2015-08-11 20:10:00-05:00 63
2015-08-11 20:11:00-05:00 73
但当我在《熊猫》中用:
^{pr2}$我希望y轴上的值以AM/PM格式显示(8:08PM),而不是军事时间(20:08)。有没有一个简单的方法可以做到这一点?在
还有,我该如何控制蜱虫的数量和与大熊猫密谋的标签?在
提前谢谢。在
你的问题有两个要素:
axis方法}控制记号和标签:
set_xticks
、set_yticks
、set_xticklabels
和{要更改时间格式,请使用pd.datetime.strftime公司:How can I convert 24 hour time to 12 hour time?
^{pr2}$这个问题涵盖了另一种绘制日期的方法:Pandas timeseries plot setting x-axis major and minor ticks and labels
相关问题 更多 >
编程相关推荐