Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
i = pd.date_range('2019-04-09', periods=5, freq='2D')
ts = pd.DataFrame({'P': [1,2,3,4,5]}, index=i)
ts
Out[2]:
P
2019-04-09 1
2019-04-11 2
2019-04-13 3
2019-04-15 4
2019-04-17 5

Get the rows for the first 3 days:

In [3]:
ts.first('3D')
Out[3]:
P
2019-04-09 1
2019-04-11 2

Note: In the above output the data for 3 first calender days were returned,
not the first 3 days observed in the dataset, and therefore data for 2019-04-13 was not returned.