I read some of the post related to this topic but nothing worked.
I am trying to convert to column of my dataframe called dem_inclusiondate
and sae_hospit_date
because I need to do a survival analysis, and need the duration between the inclusion date and the hospitalization
However, the type of these columns are Series and I can't find a way to convert them into date type.
I tried this following your comment
baseline_all_patients["dem_inclusiondate"]
.to_datetime(baseline_all_patients["dem_inclusiondate"], format="%Y-%m-%d")
but this error occurs: 'Series' object has no attribute 'to_datetime'
Sorry I am new, I don't know if my question is clear
Thank you for your help.