I want to filter the dataframe by a certain datatime period like the following code.
df2 = df2['Dates'].between_time(pandas.to_datetime('5/13/2015 8:41'), pandas.to_datetime('5/13/2015 8:55'))[['Dates','Category']]
but got an error 'TypeError: Index must be DatetimeIndex' This is the dataframe
and I tried
df2 = pandas.read_csv(path2,parse_dates=[0])
like one of the response from other post but still got the same error. Does anyone know what happen here?