I'm trying to convert a column of Year values from int64 to datetime64 in pandas. The column currently looks like
Year
2003
2003
2003
2003
2003
...
2021
2021
2021
2021
2021
However the data type listed when I use dataset['Year'].dtypes
is int64
.
That's after I used pd.to_datetime(dataset.Year, format='%Y')
to convert the column from int64 to datetime64. How do I get around this?