CommencerCommencer gratuitement

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).

Cet exercice fait partie du cours

Python for R Users

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Print time_hour
print(____)
Modifier et exécuter le code