For an easy example :
import datatable as dt
import pandas as pd
from datetime import datetime
d_t = dt.Frame(pd.DataFrame({"Date": ["04/05/2020", "04/06/2020"]}))
There is only a column named Date with two values in str32 type.
How could I convert the Date column into a Date Format in datatable frame.
I have tried
dates_list = [datetime.strptime(date, "%m/%d/%Y") for date in d_t["Date"].to_list()[0]]
d_t[:,"NewDate"] = dt.Frame(dates_list)
d_t["NewDate"].max()
# The code can run successfully so far.
But the result was shown like this :
NewDate
▪▪▪▪▪▪▪▪
0 NA
I think it was still not a date format.
Even I looked up the type of each column, I still have no idea:
d_t.stypes
[Out]: (stype.str32, stype.obj64)
Is there any way to solve the problem or any alternatives?
Thanks for answering.