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 ;


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


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

Read more here:

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: