I have a pandas DataFrame with the following column (first column = index)
:
0 14:43:45:921
1 14:43:45:923
2 14:43:45:925
I would like to modify this column, or add another column with the time starting at 0
:
0 00:00:00.000
1 00:00:00.002
2 00:00:00.004
So far, I've tried the following code:
df['time'].apply(pd.Timedelta)
This is giving me the following error:
expected hh:mm:ss format
To me, the problem is
a) convert the time format HH:MM:SS:fff
to HH:MM:SS.fff
and
b) get the timedelta
function to work.
Does anyone have any suggestions? Thanks!