Reputation: 185
I have the colomn with time but it is different from row to row. How can I put in one format?
My colomn looks following:
13:59:47
11:23:36.500000
03:26:05
00:52:10.500000
02:16:24
03:55:06.500000
03:28:51.500000
13:16:08.500000
19:03:45
12:29:03
19:29:26.500000
19:54:07.500000
12:36:14.500000
14:20:00
I need that every value has the same format. For example '%H:%M:%S.S'
The type of the values in colomn is datetime.time
Upvotes: 1
Views: 67
Reputation: 642
Consider using isoformat so that your microseconds become visible.
from datetime import time
df['column_name'] = df.column_name.apply(lambda x : x.isoformat(timespec='microseconds'))
Upvotes: 1