Convert Strings To Dates
Goal¶
This post aims to introduce how to convert strings to dates using pandas
Libraries¶
In [1]:
import pandas as pd
Date in string¶
In [3]:
df_date = pd.DataFrame({'date':['20190101', '20190102', '20190105'],
'temperature': [23.5, 32, 25]})
df_date
Out[3]:
Convert strings to date format¶
In [4]:
pd.to_datetime(df_date['date'])
Out[4]: