How to convert string variables into DateTime variables in Python?

This recipe helps you convert string variables into DateTime variables in Python
In [1]:
## How to convert string variables into DateTime variables in Python
def Kickstarter_Example_79():
    print()
    print(format('How to convert string variables into DateTime variables in Python','*^82'))

    import warnings
    warnings.filterwarnings("ignore")

    # load libraries
    import pandas as pd

    # Create a dataset with the index being a set of names
    raw_data = {'date': ['2017-09-01T01:23:41.004053', '2017-10-15T01:21:38.004053',
                         '2017-12-17T01:17:38.004053'],
                'score': [25, 94, 57]}
    df = pd.DataFrame(raw_data, columns = ['date', 'score'])
    print(); print(df); print(df.dtypes)

    # convert strings to DateTime
    df["date"] = pd.to_datetime(df["date"])
    print(); print(df); print(df.dtypes)

Kickstarter_Example_79()
********How to convert string variables into DateTime variables in Python*********

                         date  score
0  2017-09-01T01:23:41.004053     25
1  2017-10-15T01:21:38.004053     94
2  2017-12-17T01:17:38.004053     57
date     object
score     int64
dtype: object

                        date  score
0 2017-09-01 01:23:41.004053     25
1 2017-10-15 01:21:38.004053     94
2 2017-12-17 01:17:38.004053     57
date     datetime64[ns]
score             int64
dtype: object