i am working with python and i have a df as:
time
00:01:24
00:22:44
00:12:32
00:02:56
and i want to change it as
time
01:24:00
22:44:00
12:32:00
02:56:00
i first removed 00: from the column by using:
df['time'] = df['time'].str.strip('00:)
and then tried
df['time'] =pd.to_datetime(df['time'], format="%H:%M").dt.time
but is giving error as
ValueError: time data '1' does not match format '%H:%M' (match)
Eventually while striping 00: the column values are becoming
1:24
22:44
12:32
2:56
Can someone help me out.Thanks