1In [15]: df = pd.DataFrame([1, 2, 3], index=[dt.datetime(2013, 1, 1), dt.datetime(2013, 1, 3), dt.datetime(2013, 1, 5)])
2
3In [16]: df
4Out[16]:
5 0
62013-01-01 1
72013-01-03 2
82013-01-05 3
9
10In [22]: start = df.index.searchsorted(dt.datetime(2013, 1, 2))
11
12In [23]: end = df.index.searchsorted(dt.datetime(2013, 1, 4))
13
14In [24]: df.iloc[start:end]
15Out[24]:
16 0
172013-01-03 2