I have a DataFrame object named df, and I want to generate a list of properly formatted dates. (datetime module is properly imported)
I wrote:
dates = [datetime.date(df.at(index, "year"), df.at(index, "month"), df.at(index, "day")) for index in df.index]
which gives the error in the title.
If it helps, this is the value of df.head():
year month day smoothed trend
0 2011 1 1 391.26 389.76
1 2011 1 2 391.29 389.77
2 2011 1 3 391.33 389.78
3 2011 1 4 391.36 389.78
4 2011 1 5 391.39 389.79
(This is new to me, so I have likely misinterpreted the docs)