I am unable to convert my date column from my data frame from a string to date format. I've tried using the lambda date conversion code in the image above, as well as a few other methods and I can't seem to make it work. It appears to possibly be because my 'variable' column does not appear to be like the rest of the columns (I think that it is maybe "indexed?"). Help would be much appreciate!
使用to_datetime
:
Hotsprings2['variable'] = pd.to_datetime(Hotsprings2['variable'], format='%Y-%m-%d')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.