我的数据帧是这种格式
Time AvgDiff
07:00:00 7.750782
07:01:00 9.306567
07:02:00 13.225209
07:03:00 18.346431
07:04:00 10.049761
07:05:00 18.567049
07:06:00 -4.903014
07:07:00 -10.66217
我做了以下事情来创建一个合成日期,日期并不重要,因为我的AvgDiff是特定时间值的所有日期的平均值
^{pr2}$这表明
它同时显示日期和时间(在X轴上),但是我需要它只显示小时和分钟。在
我试过了
FMT = '%H:%M:%S'
df['Time'] = df['Time'].map(lambda x: datetime.strptime(str(x), FMT))
df['Time'] = df['Time'].map(lambda x: x.replace(day=date, month=month, year=year))
plt.gcf().autofmt_xdate()
plt.show()
但它产生了完全相同的图表,为什么会这样呢?在
好的,我设法解决了下面的问题
这就产生了小时:分钟在
相关问题 更多 >
编程相关推荐