【发布时间】:2018-11-15 23:17:11
【问题描述】:
我想绘制一个数据帧,它有一个 timedelta64 索引,索引在 x 轴上。
索引如下所示:
In [75]: test.index
Out[75]:
TimedeltaIndex([ '00:00:00', '00:00:00.020000', '00:00:00.040000',
'00:00:00.060000', '00:00:00.080000', '00:00:00.100000',
'00:00:00.120000', '00:00:00.140000', '00:00:00.160000',
'00:00:00.180000',
...
'07:29:31.660000', '07:29:31.680000', '07:29:31.700000',
'07:29:31.720000', '07:29:31.740000', '07:29:31.760000',
'07:29:31.780000', '07:29:31.800000', '07:29:31.820000',
'07:29:31.840000'],
dtype='timedelta64[ns]', name='master', length=923486, freq=None)
当我简单地绘制这个数据框时:
plt.plot(test)
我希望得到 x 轴上的 timedeltaindex。但是,我只是在 x 轴上得到这个:
我怎样才能在 x 轴上获得我的 TimedeltaIndex?
【问题讨论】:
标签: python matplotlib spyder timedelta