MulaiMulai sekarang secara gratis

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

Latihan ini adalah bagian dari kursus

Python for R Users

Lihat Kursus

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

# Print time_hour
print(____)
Edit dan Jalankan Kode