I have below data in Python
import pandas as pd
var1 = pd.DataFrame([0,1,2,3,4])
var2 = pd.DataFrame([6,7,8,9,10])
var = pd.concat([var1 , var2], axis = 1)
days = pd.date_range("2018-01-01", periods=5, freq="D")
Now I want to create a time series for var
with index days
and then extract subset of var
that falls between '2018-01-02'
& '2018-01-04'
Is there any way to achieve this using pandas
?
Any pointer will be very helpful