BuildlyBuildly
DashboardExercisesProfileHelp
Data Science/Module 3: Importing & Handling Files/Dates & Times3/3
Exercise·7 min·10 XP

Parse a Date Column

Context. A date column was read from CSV as plain text. Date math and .dt operations only work once it's a real datetime type.

Your task. Write to_datetime_column(df) that returns the date column converted to a pandas datetime Series.

Example. the text "2021-03-15" becomes a real datetime value.

Notes. Return the converted Series. Every value is a valid YYYY-MM-DD date string.

Previous
Extract a Pattern
Next
Extract the Month from Dates