使用df.ix [x:y]其中x和y是日期时间对象.
例:
In [117]: frame.index.summary()
Out[117]: 'DatetimeIndex: 6312960 entries, 2000-04-05 00:01:00 to 2012-04-06 00:00:00\nFreq: T'
In [118]: x=datetime(2001, 4, 5, 0, 1)
In [119]: y=datetime(2001, 4, 5, 0, 5)
In [120]: print frame.ix[x:y]
radiation tamb
2001-04-05 00:01:00 67.958873 8.077386
2001-04-05 00:02:00 50.801294 0.731453
2001-04-05 00:03:00 16.042035 6.944998
2001-04-05 00:04:00 5.678343 9.728967
2001-04-05 00:05:00 72.551601 7.652942
你也可以这样做:
In [121]: print frame.ix[x]
radiation 67.958873
tamb 8.077386
Name: 2001-04-05 00:01:00