-1

I have a dataframe with a datetime column. I want to retain only until minutes and drop the seconds and milliseconds.

enter image description here

How do I do this?

Aadith Ramia
  • 10,005
  • 19
  • 67
  • 86

1 Answers1

0

You can use this:

df['SubmitTimePst'] = pd.to_datetime(df['SubmitTimePst']).dt.strftime('%Y-%m-%d %H:%M')
Shahab Rahnama
  • 982
  • 1
  • 7
  • 14