Given a dataframe:
df = pd.DataFrame({'a': [10, 20, 40, 50,60,70,80,100]},index = pd.DatetimeIndex(['2018-02-27 09:01:00','2018-02-27 09:02:00','2018-02-27 09:04:00','2018-02-27 09:05:00','2018-03-27 09:01:00','2018-03-27 09:02:00','2018-03-27 09:03:00','2018-03-27 09:05:00']))
I hope to get the values as of 09:04, in which case it should return 2 rows with 'a' value to be 40 and 80. It seems pandas only takes datetime as input for asof() and I have to do some pre-processing to create all the filters myself. I wonder if there is already such functionality in pandas where input like 09:04 would suffice, or other simple ways to get the result.
EDIT: Sorry I put in the wrong df in the beginning - there should not be 09:04 for the 2nd day, thus need asof().
asofbecause possible40and90for09:04:30?