I am reading a dataframe:
df = pd.read_csv("file_path")
df['time'] = pd.to_datetime(df['time'], format="%Y-%m-%d")
When I want to access df['time'].dt in order to get year, month, etc. I get the error that:
'Timestamp' object has no attribute 'dt'.
There are many posts on StackOverflow related to my question. I tried the suggested solutions which was using to_pydatetime() but it did not work. I appreciate any help regarding this.