I have a snippet of the dataframe here
TIME Value1 Value2
0 2014-10-02 12:45:03 5 6
1 2014-10-02 12:45:05 6 7
2 2014-10-02 12:45:08 3 5
3 2014-10-02 12:45:09 7 4
..................... ... ...
45 2014-11-03 00:51:09 7 8
Now, I would like to get all the dataframe rows between 2014-10-02 and 2014-11-02 without knowing the exact time to the second. I tried this method as shown below, but I am getting 0 rows.
start_date = pd.to_datetime('2014-10-02 00:00:01')
end_date = pd.to_datetime('2014-11-02 00:00:01')
df.loc[(df['TIME'] > start_date) & (df['TIME'] < end_date)]
But when I put in an exact datetime value like '2014-10-02 12:45:03' for the start date and end date, I get the output. The data has millions of rows and I could not possibly find out the exact time to the second for the start date and end date. I just need to get rows between two dates.