I currently have two columns within my dataframe in the following format:
Col1 = 2020-12-04T20:16:26+00:00
Col2 = 2020-12-04T20:58:14+00:00
I just want to create a new column that is the time difference between these two values. I've tried the following but encounter an error:
df['Subtract_time'] = df['Col1'] - df['Col2']
Error: unsupported operand type(s) for -: 'str' and 'str'
Additionally, how would I utilize .strptime() to extract just the date from the timestamp. I've tried the following to no avail.....is there any type of guide to understand what combination of '%Y/%m/%d/%h/%M/%S' for any given timestamp?
date_time_obj = datetime.datetime.strptime(date_time_str, '%Y-%m-%d %H:%M:%S.%f')