Python - convert date string from YYYY-MM-DD to DD-MMM-YYYY using datetime?

前端 未结 2 1297
不思量自难忘°
不思量自难忘° 2021-01-23 11:43

So I have read a number of threads on this, and am still stumped. Any help would be sincerely appreciated.

I have a column in a dataframe that contains strings of dates,

2条回答
  •  爱一瞬间的悲伤
    2021-01-23 12:11

    No need apply by using pd.to_datetime

    pd.to_datetime(df_combined['VisitDate'],errors='coerce',format='%d-%b-%Y').fillna('')
    

提交回复
热议问题