I have the following dataframe with more than 400 000 lines.
df = pd.DataFrame({'date' : ['03/02/2015 23:00',
'03/02/2015 23:30',
'04/02/2015 00:00',
'04/02/2015 00:30',
'04/02/2015 01:00',
'04/02/2015 01:30',
'04/02/2015 02:00',
'04/02/2015 02:30',
'04/02/2015 03:00',
'04/02/2015 03:30',
'04/02/2015 04:00',
'04/02/2015 04:30',
'04/02/2015 05:00',
'04/02/2015 05:30',
'04/02/2015 06:00',
'04/02/2015 06:30',
'04/02/2015 07:00']})
I am trying to parse the date column of a csv file in pandas as fast as possible. I know how to do it with read_csv but that takes a lot of time! Also, I have tried the following which works but which is also very slow: df['dateTimeFormat'] = pd.to_datetime(df['date'],dayfirst=True)
How could I parse efficiently and in a really fast way the date column to datetime?
Thank you very much for your help,
Pierre