I have a wide Pandas dataframe with TimeIndexed values and I wanted to select with an Interval object that I made:
inter = pd.Interval(pd.Timestamp('2017-12-05 16:36:17'),
pd.Timestamp('2017-12-05 22:00:00'), closed='left')
I tried loc and iloc method but they don't accept Interval instance as argument.
I can test if a Timestamp is in that Interval that way:
pd.Timestamp('2017-12-05 22:00:00') in inter
But I'm not able to write a line to select the row of the dataframe.
df.loc[inter.left:inter.right]
, although this won't respectclosed='left'
orclosed='right'
. – Siu