I have a DataFrame with column named date. How can we convert/parse the \'date\' column to a DateTime object?
I loaded the dat
pandas already reads that as a datetime object! So what you want is to select rows between two dates and you can do that by masking:
df_masked = df[(df.date > '2012-04-01') & (df.date < '2012-04-04')]
Because you said that you were getting an error from the string for some reason, try this:
df_masked = df[(df.date > datetime.date(2012,4,1)) & (df.date < datetime.date(2012,4,4))]