I have a dataframe with datetime as index. similar to the below one
>>> data.index
Index(['2019-05-15 23:45:00', '2019-05-15 23:46:00', '2019-05-15 23:47:00',
'2019-05-15 23:48:00', '2019-05-15 23:49:00', '2019-05-15 23:50:00',
'2019-05-15 23:52:00', '2019-05-15 23:53:00', '2019-05-15 23:54:00',
'2019-05-15 23:55:00',
...
'2019-05-19 05:36:00', '2019-05-19 05:37:00', '2019-05-19 05:38:00',
'2019-05-19 05:39:00', '2019-05-19 05:40:00', '2019-05-19 05:41:00',
'2019-05-19 05:42:00', '2019-05-19 05:43:00', '2019-05-19 05:44:00',
'2019-05-19 05:45:14'],
dtype='object', name='date', length=989)
I need to select all the rows which corresponding to the date 2019-05-16. I tried these two methods.
1) data['2019-05-16'] gives KeyError: '2019-05-16'
2) data.loc['2019-05-16'] gives KeyError: 'the label [2019-05-16] is not in the [index]'