How do I convert dates in a Pandas data frame to a 'date' data type?

I have a Pandas data frame, one of the columns of which contains date strings in the format 'YYYY-MM-DD' e.g. '2013-10-28'.

At the moment the dtype of the column is 'object'.

How do I convert the column values to Pandas date format?

Use astype

    In [31]: df
    Out[31]: 
       a        time
    0  1  2013-01-01
    1  2  2013-01-02
    2  3  2013-01-03

    In [32]: df['time'] = df['time'].astype('datetime64[ns]')

    In [33]: df
    Out[33]: 
       a                time
    0  1 2013-01-01 00:00:00
    1  2 2013-01-02 00:00:00
    2  3 2013-01-03 00:00:00

From: stackoverflow.com/q/16852911