How to remove microseconds from time field

I have a time field which i have used;

df['Time'] = pd.to_datetime(df['Time'],format= '%H:%M:%S.%f' ).dt.time

The output it is giving me is ;

10:52:01.671000

I need to get rid of the millisedconds and remain with only the H:M:S;

10:52:01

How can i do this. I have tried different options but cannot seem to get it.



Read more here: https://stackoverflow.com/questions/68463195/how-to-remove-microseconds-from-time-field

Content Attribution

This content was originally published by Kamikaze K at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: