【发布时间】:2016-05-07 19:48:14
【问题描述】:
我有一个数据框:
Actual Pred
Date
2005-04-01 10.2 10.364470
2005-05-01 9.4 9.542778
2005-06-01 9.5 9.684794
2005-07-01 9.4 9.547604
2005-08-01 9.7 9.768893
我想为每个 DataFrame 的索引添加一个月,所以它看起来像这样:
Actual Pred
Date
2005-05-01 10.2 10.364470
2005-06-01 9.4 9.542778
2005-07-01 9.5 9.684794
2005-08-01 9.4 9.547604
2005-09-01 9.7 9.768893
我该怎么做?
重要评论:
当我命令print type(DataFrame.index[0])找出索引的数据类型时,我得到:
<class 'pandas.tslib.Timestamp'>
只是为了让您知道它是 Pandas 时间戳。
【问题讨论】:
标签: python datetime pandas timestamp