1. Learn
  2. /
  3. Courses
  4. /
  5. Working with Dates and Times in Python

Connected

Exercise

How long per weekday?

Pandas has a number of datetime-related attributes within the .dt accessor. Many of them are ones you've encountered before, like .dt.month. Others are convenient and save time compared to standard Python, like .dt.day_name().

Instructions

100 XP
  • Add a new column to rides called 'Ride start weekday', which is the weekday of the Start date.
  • Print the median ride duration for each weekday.