Part 3 – Adding data exploration to the USFlightsAnalysis PixieApp
In this section, we want to extend the route analysis screen of the USFlightsAnalysis
PixieApp to add two charts showing the historical arrival delay for each airline that flies out of the selected origin airport: one for all the flights coming out of the origin airport and one for all the flights regardless of airport. This will give us a way to compare visually whether the delay for a particular airport is better or worse than for all the other airports.
We start by implementing a method that selects the flights for a given airline. We also add an optional airport argument that can be used to control whether we include all flights or only the one that originates from this airport. The returned DataFrame should have two columns: DATE
and ARRIVAL_DELAY
.
The following code shows the implementation of this method:
def compute_delay_airline_df(airline, org_airport=None): # create a mask for selecting the data mask = (flights...