Reputation: 93
I have 2 columns containing date and time(hr,min,seconds:milliseconds) How do I remove the milliseconds from only one of the column?
Name MinTime MaxTime
John 2020-02-20 12:00:00.12345 2020-02-20 12:00:00.12345
Desired Output
Name MinTime MaxTime
John 2020-02-20 12:00:00 2020-02-20 12:00:00.12345
Upvotes: 0
Views: 945
Reputation: 93
I convert the timestamp into datetime format
df['MinTime']=pd.to_datetime(df['MinTime'])
df['MinTime'] = df['MinTime'].astype('datetime64[s]')
Upvotes: 0