Skip to content
skillbld
Day 6 of 14 30 minto_datetime().dt accessorresample()

Work with dates the pandas way. Parse text into real dates with to_datetime(), pull out parts like month and weekday with .dt, filter by date ranges, do date arithmetic, and summarise by day, week or month with resample().

By the end of today you can

  • Convert text to dates with pd.to_datetime() and parse_dates
  • Extract parts of a date with the .dt accessor
  • Filter rows by date and calculate differences with Timedelta
  • Summarise data by day, week or month with resample()
  • Spot common date pitfalls, such as day-first formats

What's inside

  • 4 sections
  • 3 diagrams and mind maps
  • 5 code examples you can run
  • 5-question quiz
  1. 1Text isn't a date (yet)
  2. 2The .dt accessor: parts of a date
  3. 3Filtering and date maths
  4. 4resample(): summarise by period

Sign in free to read this lesson

Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.

Sign in free
Day 6: Dates & Times · Data Analysis with pandas · SkillBld