I have two date time dataframes which looks like: df1:
0 2020-03-16 14:00:00
1 2020-03-16 17:00:00
2 2020-03-16 20:00:00
3 2020-03-16 20:00:00
4 2020-03-16 19:00:00
5 2020-03-16 12:00:00
6 2020-03-16 18:00:00
df2:
0 2020-03-16 09:00:00
1 2020-03-16 09:00:00
2 2020-03-16 09:00:00
3 2020-03-16 08:30:00
4 2020-03-16 08:30:00
5 2020-03-16 08:30:00
6 2020-03-16 09:00:00
I wanted to delete df2 from df1 and convert the result into minutes. For that purpose I am converting each dataframe into datetime.strptime by using following code:
datetime.strptime(df1.to_string(),'%Y-%m-%d %H:%M:%S')
However, when I run above code, it throws an error message of Value error and it says that value does not match format '%Y-%m-%d %H:%M:%S'
. Could anyone point out where am I making the mistake?