AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Since there won’t be room to fit every airport on the chart, we’ll pick five airports: Salt Lake City, Newark, Denver (DEN), New York (JFK), and San Francisco (SFO). assign(PropTypeOfDelay=lambda x: x / x.groupby("AirportCode").transform("sum")) assign(PropFlightsDelayed=lambda x: x / x) assign(TypeOfDelay=lambda x: x.str.replace("NumDelays", "")) "NumDelaysSecurity", "NumDelaysCarrier"], Value_vars=["NumDelaysLateAircraft", "NumDelaysWeather", delays_by_airport_and_cause = (Īirlines[["AirportCode", "NumDelaysLateAircraft", To make this plot, we need to first create another summary DataFrame, this time finding the proportion of flights that were delayed by the airport and the cause of the delay. For instance, we might want to know why flights are getting delayed for each airport. This can allow you to get further insight into why groups differ from each other. If you want to explore your data a bit more deeply, you can also group your barplots by an additional categorical variable. Salt Lake City (SLC) has only 15% of flights delayed, while a whopping 29% of flights at Newark (EWR) were delayed. Most airports have less than 20% of their flights delayed over the whole data period, but there are some clear outliers. This plot allows us to get a really good sense of how airports compare in terms of how many of their flights are delayed.
0 Comments
Read More
Leave a Reply. |