Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/main/08. Data Visualization with Python/Final Assignment/Flight Delay Time Statistics Dashboard.ipynb
Views: 4598
Objective
Create an airline delay dashboard
Dashboard components:
Monthly average carrier delay by reporting airline for the given year.
Monthly average weather delay by reporting airline for the given year.
Monthly average natioanl air system delay by reporting airline for the given year.
Monthly average security delay by reporting airline for the given year.
Monthly average late aircraft delay by reporting airline for the given year.
NOTE: Year range should be between 2010 and 2020
TODO:
Design layout for the application.
Create a callback function. Add callback decorator and define inputs and outputs.
Call
compute_info
with appropriate parameters.Create 5 line graphs.
Run the application.
App Skeleton
Helper to fill TODOs
TODO1
Deals with providing title to the dashboard and styling it.
Title as
Flight Delay Time Statistics
, align text ascenter
, color as#503D36
, and font size as30
.Style sample:
style={'textAlign': 'right', 'color': '#000000', 'font-size': 0})
TODO2
Deals with creating dash input core component and styling it
Set id for the component as
input-year
, default value as2010
, and type asnumber
.Style: provide height of the input box to be
35px
and font size as30
.Style sample:
style={'height':'3px', 'font-size': 00}
TODO3
Deals with adding graph component and providing ids.
Add dcc.Graph component.
Provide ids in the following order
carrier-plot
,weather-plot
,nas-plot
,security-plot
, andlate-plot
.
TODO4
Deals with structing callback output components.
List containing component id and component property.
Component id will be similar to
TODO3
ids and property will befigure
.
TODO5
Deals with extracting computed data for creating graphs.
Function will be returning 5 computed dataframes. set returned dataframes names to be
avg_car, avg_weather, avg_NAS, avg_sec, avg_late
.
TODO6
Deals with creating line plots using returned dataframes from the above step using plotly.express
. Link for reference is here
1. Monthly average carrier delay by reporting airline for the given year
Set figure name as
carrier_fig
, data asavg_car
, x asMonth
, y asCarrierDelay
, color asReporting_Airline
andtitle
asAverage carrrier delay time (minutes) by airline
.Sample:
carrier_fig = px.line(avg_car, x='Month', y='CarrierDelay', color='Reporting_Airline', title='Average carrrier delay time (minutes) by airline')
2. Monthly average weather delay by reporting airline for the given year
Set figure name as weather_fig
, data as avg_weather
, x as Month
, y as WeatherDelay
, color as Reporting_Airline
and title
as Average weather delay time (minutes) by airline
.
3. Monthly average natioanl air system delay by reporting airline for the given year
Set figure name as nas_fig
, data as avg_NAS
, x as Month
, y as NASDelay
, color as Reporting_Airline
and title
as Average NAS delay time (minutes) by airline
.
4. Monthly average security delay by reporting airline for the given year
Set figure name as sec_fig
, data as avg_sec
, x as Month
, y as SecurityDelay
, color as Reporting_Airline
and title
as Average security delay time (minutes) by airline')
.
5. Monthly average late aircraft delay by reporting airline for the given year
Set figure name as late_fig
, data as avg_late
, x as Month
, y as LateAircraftDelay
, color as Reporting_Airline
and title
as Average late aircraft delay time (minutes) by airline
.