0

when using python and pandas I want to convert time full datetime [ns] format to YYYY-mm-dd format. When applying the format according to instructions, it does not apply at all.

pd.to_datetime(df.datum, format='%Y-%m-%d') pd.to_datetime(df.datum.astype('str'), format='%Y-%m-%d')
Result in: 2018-09-02 09:47:53enter image description here

I would like to understand how to properly use the inbuilt format-parameter for pd.datetime to make it apply completely. Any ideas?

karwi
  • 23
  • 3
  • I don't think you got the question. Im aware of changing the date format through string methods. The question in this case is really, how come the format-hyperparameter within pd.to_datetime but it does not work? – karwi Sep 20 '22 at 11:38

0 Answers0