|
40 | 40 | from skrub.datasets import fetch_flight_delays |
41 | 41 |
|
42 | 42 | dataset = fetch_flight_delays() |
43 | | -weather = dataset.weather |
| 43 | +weather = pd.read_csv(dataset.weather_path) |
44 | 44 | weather = weather.sample(100_000, random_state=0, ignore_index=True) |
45 | | -stations = dataset.stations |
| 45 | +stations = pd.read_csv(dataset.stations_path) |
46 | 46 | weather = stations.merge(weather, on="ID")[ |
47 | 47 | ["LATITUDE", "LONGITUDE", "YEAR/MONTH/DAY", "TMAX", "PRCP", "SNOW"] |
48 | 48 | ] |
|
128 | 128 | # ``'Origin'`` which refers to the departure airport’s IATA code. We use only a subset |
129 | 129 | # to speed up the example. |
130 | 130 |
|
131 | | -flights = dataset.flights |
| 131 | +flights = pd.read_csv(dataset.flights_path) |
132 | 132 | flights["Year_Month_DayofMonth"] = pd.to_datetime(flights["Year_Month_DayofMonth"]) |
133 | 133 | flights = flights[["Year_Month_DayofMonth", "Origin", "ArrDelay"]] |
134 | 134 | flights = flights.sample(20_000, random_state=0, ignore_index=True) |
135 | | -airports = dataset.airports[["iata", "airport", "state", "lat", "long"]] |
| 135 | +airports = pd.read_csv(dataset.airports_path)[ |
| 136 | + ["iata", "airport", "state", "lat", "long"] |
| 137 | +] |
136 | 138 | flights = flights.merge(airports, left_on="Origin", right_on="iata") |
137 | 139 | # printing the first row is more readable than the head() when we have many columns |
138 | 140 | flights.iloc[0] |
|
0 commit comments