Recode dates
Now let's look at another dataset in the nycflights13 datasets,
specifically the flights
dataset.
This dataset gives us the time when a particular flight departed from one of the New York City airports (JFK, LGA, EWR),
it's scheduled departure and arrival times, and the departure and arrival delays.
You'll begin by investigating to determine if there are any seasonal patterns for delays.
Here are the cutoff times for each season in the United States.
SPRING EQUINOX | March 20 |
SUMMER SOLSTICE | June 21 |
FALL EQUINOX | September 22 |
WINTER SOLSTICE | December 21 |
We defined the get_season()
function that converts a given date to a season (one of winter
, spring
, summer
, and fall
).
This exercise is part of the course
Python for R Users
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Print time_hour
print(____)