大熊猫前一天的同一时间

时间:2018-12-01 14:16:05

标签: python pandas

我有一个DatetimeIndex,即:

DatetimeIndex(['2004-01-02 00:00:00', '2004-01-02 00:01:00',
           '2004-01-02 00:02:00', '2004-01-02 00:03:00',
           '2004-01-02 00:04:00', '2004-01-02 00:05:00',
           '2004-01-02 00:06:00', '2004-01-02 00:07:00',
           '2004-01-02 00:08:00', '2004-01-02 00:09:00',
           ...
           '2015-12-31 23:50:00', '2015-12-31 23:51:00',
           '2015-12-31 23:52:00', '2015-12-31 23:53:00',
           '2015-12-31 23:54:00', '2015-12-31 23:55:00',
           '2015-12-31 23:56:00', '2015-12-31 23:57:00',
           '2015-12-31 23:58:00', '2015-12-31 23:59:00'],
          dtype='datetime64[ns]', length=4350240, freq=None)

给定一个索引点i,我想获取同一时间但前一天可用的索引(不是昨天!因为不是所有的天都在索引中)。

0 个答案:

没有答案