I have a pandas column (Series) with the below rows:
DATETIMEOFCALL
--------------
13/12/2021 14:58
13/12/2021
13/12/2021 14:57:12
How could I convert them to pd.timestamp at once?
So far, I've done this, but it returns NaT for the second and third rows.
df['DATETIMEOFCALL'] = pd.to_datetime(df['DATETIMEOFCALL'], format='%d/%m/%Y %H:%M', errors='coerce')
I would like to obtain a column with all the values in datetime format.
EDIT: Minimal Reproducible Example.
datetimes= {
'DATETIMEOFCALL': [
'12/10/2021 15:30',
'10/12/2021',
'10/12/21',
'12/10/2021 14:59:59',
'12/10/2021 14:59:69',
None,
]
}
df = pd.DataFrame(datetimes)