Course Content
Dealing with Dates and Times in Python
Dealing with Dates and Times in Python
3. Timezones and Daylight Savings Time (DST)
4. Working with Dates and Times in pandas
Challenge: What Will We Work With?Challenge: Converting Columns into datetime TypeChallenge: Extreme Trips DurationsChallenge: InvestigationChallenge: Negative Trip DurationChallenge: Is this Common Issue?Challenge: Fixing the IssuesChallenge: Average Metrics Across Taxi TypesChallenge: Corrected Metrics Across Taxi TypesChallenge: Group by Period?
One More Formatting
Let's practice more with date formats! The table with the most common codes is below.
Format code | Meaning | Example |
---|---|---|
%d | Day of the month as a zero-padded decimal number | 01, 02, ..., 30, 31 |
%m | Month as a zero-padded decimal number | 01, 02, ..., 11, 12 |
%y | Year without century as a zero-padded decimal number | 00, 01, 02, ..., 98, 99 |
%Y | Year with century as a decimal number | 0001, 0002, 1999, 2000, 2001, ... |
%b | Month as localeβs abbreviated name | Jan, Feb, ..., Nov, Dec |
%B | Month as localeβs full name | January, February, ..., November, December |
%a | Weekday as localeβs abbreviated name | Sun, Mon, ..., Fri, Sat |
%A | Weekday as localeβs full name | Sunday, Monday, ..., Friday, Saturday |
Task
Swipe to start coding
Format the same date
object as before into the format: "Wednesday, 11 of March, 1998".
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 6
One More Formatting
Let's practice more with date formats! The table with the most common codes is below.
Format code | Meaning | Example |
---|---|---|
%d | Day of the month as a zero-padded decimal number | 01, 02, ..., 30, 31 |
%m | Month as a zero-padded decimal number | 01, 02, ..., 11, 12 |
%y | Year without century as a zero-padded decimal number | 00, 01, 02, ..., 98, 99 |
%Y | Year with century as a decimal number | 0001, 0002, 1999, 2000, 2001, ... |
%b | Month as localeβs abbreviated name | Jan, Feb, ..., Nov, Dec |
%B | Month as localeβs full name | January, February, ..., November, December |
%a | Weekday as localeβs abbreviated name | Sun, Mon, ..., Fri, Sat |
%A | Weekday as localeβs full name | Sunday, Monday, ..., Friday, Saturday |
Task
Swipe to start coding
Format the same date
object as before into the format: "Wednesday, 11 of March, 1998".
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 6