I have a following Pandas DataFrame:
df = pd.DataFrame({'a': ['2020-01-02', '2020-01-02']})
Obviously, the column 'a' is string. I want to convert it to 'Date' type; and here is what I did:
df['a'] = df['a'].apply(pd.to_datetime).dt.date
It works, but in reality my DataFrame has 500,000 + rows. It seems to be very inefficient. Is there any way to directly and more efficiently convert string column to Date column?