Analysis of Flight Delays and Airline Performance
Presented by Team 1 DA-2
Flight delays and airline performance. Flight delays, defined as the departure or arrival of an aircraft beyond its scheduled time, stem from a variety of factors including adverse weather conditions, technical glitches, air traffic congestion, and operational issues at airports. These delays not only impact passenger satisfaction but also generate additional costs for airlines and can trigger subsequent disruptions in flight schedules.
On the other hand, airline performance is gauged through metrics such as on-time performance, frequency of delays and cancellations, quality of customer service, and operational efficiency. By evaluating historical data, the analysis aims to assess how effectively airlines manage flight delays and compare their performance levels. Ultimately, the study endeavors to provide a comprehensive understanding of the frequency and causes of flight delays, as well as the efficiency of airlines in addressing these issues and delivering satisfactory services to passengers.
Analysis of Flight Delays and Airline Performance
Ryan Gading Abdullah
Dina Dwi Anisa
Salma Yuhyi Anjani
Zulaikha Anissa Azfa
Dzulseva Wuquf Nugroho
Team Member’s
Contents
01
02
04
05
06
07
08
03
Business Understanding
Data Wrangling
Assessing Data
Data Exploratory
Visualization Analysis
Data Visualization
(Tableau)
Project Conclusions
Link Sources
Business Understanding
Business Understanding
Airlines face challenges related to flight delays that can affect customer satisfaction, and operations. Therefore, flight data analysis is important to identify factors causing delays and optimize flight operations to improve efficiency and customer satisfaction.
Data Wrangling
Data Wrangling
In the data wrangling section, several steps will be taken to process the data starting from importing the library, importing the data, to assessing the data by performing steps, including understanding the data, checking the data, and cleaning the data.
According to the program snippet above, it explains that:
1. We will import pandas for data manipulation and analysis,
2. matplotlib for creating static visualizations,
3. seaborn for enhancing visualizations with additional functionality,
4. IPython.display and import display for displaying dataframes and other outputs in a Jupyter notebook.
5. import plotly.express as px for creating interactive visualizations.
Import Library
This step is to connect Google Colab with Google Drive to access the dataset in Google Drive. And then, is to access the dataset and load to Google Colab. After that we check the data whether it has been successfully loaded
Gathering Data
Assessing Data
In this section, will understanding dataset according to Business Understanding by using:
“df.info” to check data types, column, NULL data, etc.
“df.column” to check column of data
“df.describe” to check data description every each column of data
Data Understanding
Data Understanding (Conclusion)
According to the Business Understanding and Data Understanding that has been done, it can be concluded that the metrics used are:
In this step, the code performs a comprehensive data quality check on a given DataFrame df. Initially, it calculates the number of missing values in each column, which helps identify any gaps in the data. Then, it computes the percentage of missing values relative to the total number of rows, providing a clear indication of the extent of missing data. The code also determines the data type of each column, which is essential for understanding how the data can be processed and analyzed. Additionally, it counts the number of unique values in each column, offering insights into the diversity of the data entries. Lastly, it checks for duplicate rows, which is crucial for ensuring data integrity and avoiding redundancy.
Check Data
In this step, the code performs tasks to analyze the presence of missing values in a dataset. Initially, it calculates the total number of missing values in each column using df.isnull().sum() and stores the results in missing_values_count. Next, it determines the proportion of missing values in each column by dividing the missing counts by the total number of rows in the dataset and multiplying by 100, storing these percentages in missing_values_percentage. The code then creates a DataFrame called missing_summary, which combines the counts and percentages of missing values into a single table. Then, it filters and displays only those columns that have missing values along with their respective proportions, helping to identify areas in the dataset that require attention for data cleaning.
Cleaning Data
The provided code does the following:
summary of the DataFrame df, including information about its columns, data types, and memory usage. It displays the count of non-null values in each column, which can help in understanding the completeness of the dataset and identifying any remaining missing values.
Cleaning Data
Data Exploratory
Data Exploratory
In data exploratory, carried out to answer the questions that have been asked in the business understanding section and determine the data fields that will be used based on the results of data understanding.
Data Exploratory
The code provides summary statistics for numerical and categorical variables in the flight dataset.
For numerical variables, it calculates count, mean, standard deviation, quartiles, and range.
For categorical variables, it counts non-null values, unique categories, the most frequent category, and its frequency.
These statistics offer a concise overview of the dataset's characteristics, aiding in understanding its distribution and composition.
Data Exploratory
Data Exploratory
Data Exploratory
Data Exploratory
The code segment calculates and identifies airlines with the highest mean departure delays within the flight dataset.
First, it groups the dataset by airline name and calculates the mean departure delay for each airline. This results in a DataFrame named `airlines_delays`, containing two columns: "name" for airline names and "mean_dep_delay" for corresponding mean departure delays.
Next, the code sorts the `airlines_delays` DataFrame in descending order based on mean departure delays and selects the top 9 airlines with the highest mean departure delays. These airlines are stored in the DataFrame `top_airlines_by_delay`.
Overall, this analysis offers insights into which airlines experience the most substantial average departure delays, aiding in understanding performance variations among airlines in terms of punctuality.
Data Exploratory
Data Exploratory (Metrics I)
Is there a relationship between a particular month and the level of flight delays?
The provided code aggregates flight data by month, aiming to discern patterns in departure and arrival delays. Initially, it groups the dataset by month, calculating the mean departure and arrival delays for each month. This step generates a new DataFrame, "month_delay," encapsulating the average delays per month. Subsequently, the Data Frame is sorted based on the highest average departure delays, followed by the highest average arrival delays. This arrangement facilitates the identification of months with the most pronounced delays. By organizing the data in this manner, analysts can discern trends over time, aiding in the formulation of targeted strategies to mitigate delays and improve overall flight punctuality.
Data Exploratory (Metrics I)
Is there a relationship between a particular month and the level of flight delays?
Data Exploratory (Metrics II)
How does scheduled departure time affect flight delays?
The code processes a flight dataset to analyze delays and their relationship with scheduled departure times. First, it converts the `sched_dep_time` column to an hour format by dividing the time values by 100. It then displays basic statistics for scheduled departure hours, departure delays, and arrival delays. Next, it calculates average delays for each scheduled departure hour by grouping the data and computing the mean departure and arrival delays. The resulting table is printed for clarity. Finally, the code calculates and prints the correlation matrix between scheduled departure time, departure delay, and arrival delay, providing insights into how these variables are related. This analysis helps to understand patterns in flight delays based on the time of day flights are scheduled to depart.
Data Exploratory (Metrics II)
How does scheduled departure time affect flight delays?
Data Exploratory (Metrics III)
Do departure delays have a significant effect on arrival delays?
The code analyzes the relationship between departure and arrival delays in a flight dataset by grouping data by the minute and calculating mean delays. It first groups the dataset by the `minute` column, calculating the average departure (`dep_delay`) and arrival (`arr_delay`) delays for each minute. The correlation coefficient between these mean delays is then computed to assess the strength of their relationship. The correlation is printed, and based on its value, a summary is provided indicating the strength of the correlation: strong, moderate, weak, or negligible. This analysis helps determine how closely departure delays are related to arrival delays.
Data Exploratory (Metrics III)
Do departure delays have a significant effect on arrival delays?
Data Exploratory (Metrics IV)
Do flight delays occur more frequently on certain days of the week?
The code analyzes flight data to understand average departure and arrival delays across different days of the week. It creates a 'day_of_week' column by converting the 'day' column to day names. Then, it calculates mean and median delays for departure and arrival, grouping by 'day_of_week'. The results are printed after reindexing to ensure days are in order from Monday to Sunday. This analysis provides insights into flight punctuality patterns, aiding strategic decisions for airlines and airports.
Data Exploratory (Metrics IV)
Do flight delays occur more frequently on certain days of the week?
The provided code segment calculates the average departure delay for each airline per year within the flight dataset. Initially, the data is grouped based on two criteria: airline name ('name') and year. Then, within each group, the mean departure delay is computed. The resulting DataFrame, "delay_by_airline_year," presents a clear overview of the average departure delay experienced by each airline across different years. This analysis offers valuable insights into the performance of individual airlines over time, aiding in the identification of trends and areas for potential improvement in scheduling or operational practices.
Data Exploratory (Metrics V)
What airlines have more flight delays in an average year?
Visualization Analysis (Data Visualization)
Visualisation Analysis
(Data Visualization)
In data visualization, it is done to visualize the answers that have been obtained based on the data exploration that has been carried out by using bar chart, line chart, and scatter plot.
Data Visualization (Metrics I)
Is there a relationship between a particular month and the level of flight delays?
The code generates a bar chart using Matplotlib to display average flight delays categorized by month. It compares average departure and arrival delays across the twelve months of the year. Each month is represented by two bars: one for departure delays (`dep_delay`) and another for arrival delays (`arr_delay`). The chart uses different colors (skyblue for departure and salmon for arrival) to distinguish between the types of delays. Axis labels, a title, and a legend are included for clarity, while gridlines aid in visual comparison. This visualization is useful for identifying monthly variations in flight punctuality.
Is there a relationship between a particular month and the level of flight delays?
The chart shows average flight delays per month. Key conclusions are:
1. Summer (June, July, August): Highest delays (20-21 mins departure, 16-17 mins arrival) due to high passenger volume and bad weather.
2. Winter (December): High delays (16-17 mins) due to bad weather and high passenger volume during holidays.
3. Early Year (January, February): Moderate delays (10 mins departure, 5-6 mins arrival) due to winter weather.
4. Fall (September, October, November): Lowest delays (some flights arrive early) due to stable weather and lower passenger volume.
5. Spring (March, April, May): Moderate delays (12-14 mins departure, 3-11 mins arrival) due to variable weather.
6. Other Factors: Operational issues, air traffic management, security, and airport construction also affect delays.
Overall, highest delays occur in summer and holiday seasons, while fall has the lowest delays.
Data Visualization (Metrics II)
How does scheduled departure time affect flight delays?
The code generates interactive line graphs using Plotly to visualize average flight delays based on scheduled departure hours. It creates a line graph from the `average_delays` DataFrame, where the x-axis represents scheduled departure hours, and the y-axis shows average departure delays and average arrival delays. The graph's appearance is customized by setting the title to "Average Flight Delays by Scheduled Departure Hour," and appropriately labeling the x-axis, y-axis, and legend. Finally, the interactive graph is displayed, allowing users to explore data trends, such as identifying specific hours when delays are most common. This visualization provides a clear and interactive way to understand flight delay patterns throughout the day.
According to the visualization of the graph, earlier departure times in the morning tend to have a lower risk of delays compared to departure times in the afternoon or evening. The increase in delays in the afternoon and evening suggests that flights during these hours are more prone to operational disruptions that can cause delays.
Data Visualization (Metrics III)
Do departure delays have a significant effect on arrival delays?
The code generates an interactive scatter plot using Plotly to visualize the relationship between departure and arrival delays. It plots the data from the `minute_delay` DataFrame, with departure delays on the x-axis and arrival delays on the y-axis, adding a trendline to show the linear relationship between these variables. The plot is customized by setting the axis titles to "Departure Delay (minutes)" and "Arrival Delay (minutes)" and centering the main title "Relationship between Departure Delays and Arrival Delays." Finally, the plot is displayed interactively, allowing users to explore the data by zooming in and hovering over points to see specific values. This visualization aids in understanding how delays at departure influence arrival times.
Based on this visualization, it can be concluded that departure delay has a significant effect on arrival delay. This relationship is positive linear, indicating that efforts to reduce departure delays will have a direct impact on reducing arrival delays. In the negative linear part, it indicates that departure and arrival delays do not occur, but are on time according to the available schedule. This is important information for airport managers and airlines to improve efficiency and customer satisfaction.
Data Visualization (Metrics IV)
Do flight delays occur more frequently on certain days of the week?
The provided code segment utilizes Matplotlib to visualize average flight delays across days of the week. It begins by extracting mean delay values from the `delay_stats` DataFrame, focusing on aggregated statistics likely grouped by day of the week. The subsequent bar plot illustrates these mean delays, differentiating between average departure and arrival delays. The x-axis denotes each day of the week, while the y-axis represents delay in minutes. The plot includes a title, axis labels, and a legend for clarity, facilitating easy comparison of delay patterns throughout the week. This visualization aids in identifying trends or variations in flight punctuality across different weekdays.
Based on this visualization, it can be concluded that there is a clear relationship between the day of the week and the level of flight delays:
This insight is valuable for airlines and passengers to better plan their schedules, anticipate potential delays, and improve overall operational efficiency and customer satisfaction by understanding and mitigating the patterns of delays throughout the week.
Data Visualization (Metrics V)
What airlines have more flight delays in an average year?
The provided code creates an interactive bar chart using Plotly to display the average departure delay by airline and year. It leverages Plotly Express to generate a grouped bar chart, where the x-axis represents airline names, and the y-axis shows average departure delays. The bars are grouped and colored by year. Custom labels for the axes and a chart title enhance readability. The layout is further customized by setting titles for the y-axis, x-axis, and legend. The legend is displayed by default but can be hidden by uncommenting a line in the code. This interactive chart allows users to easily compare departure delays across airlines and years.
Based on the visualized graph, it can be concluded that airlines such as ExpressJet Airlines Inc, Frontier Airlines Inc, Southwest Airlines Co, and Mesa Airlines Inc tend to experience more flight delays in a year compared to other airlines. These airlines may need to make improvements in their operations to reduce delays and improve on-time departures.
Data Visualization (Tableau)
The code saves the month_delay_sorted DataFrame to a CSV file in a specified Google Drive directory. It prompts the user to enter a file name without the .csv extension. The code then constructs the full path by appending the provided name and .csv extension to the Google Drive directory path. The DataFrame is saved to this path in CSV format, and a confirmation message is printed, displaying the file's location. This ensures the modified DataFrame is stored in Google Drive with a user-specified name.
Export to File
Export to File
The chart shows average flight delays per month. Key conclusions are:
1. **Summer (June, July, August)**: Highest delays (20-21 mins departure, 16-17 mins arrival) due to high passenger volume and bad weather.
2. **Winter (December)**: High delays (16-17 mins) due to bad weather and high passenger volume during holidays.
3. **Early Year (January, February)**: Moderate delays (10 mins departure, 5-6 mins arrival) due to winter weather.
4. **Fall (September, October, November)**: Lowest delays (some flights arrive early) due to stable weather and lower passenger volume.
5. **Spring (March, April, May)**: Moderate delays (12-14 mins departure, 3-11 mins arrival) due to variable weather.
**Other Factors**: Operational issues, air traffic management, security, and airport construction also affect delays.
Overall, highest delays occur in summer and holiday seasons, while fall has the lowest delays.
Data Visualization (Metrics I)
Is there a relationship between a particular month and the level of flight delays?
According to the visualization of the graph, earlier departure times in the morning tend to have a lower risk of delays compared to departure times in the afternoon or evening. The increase in delays in the afternoon and evening suggests that flights during these hours are more prone to operational disruptions that can cause delays.
Data Visualization (Metrics II)
How does scheduled departure time affect flight delays?
Based on this visualization, it can be concluded that departure delay has a significant effect on arrival delay. This relationship is positive linear, indicating that efforts to reduce departure delays will have a direct impact on reducing arrival delays. In the negative linear part, it indicates that departure and arrival delays do not occur, but are on time according to the available schedule. This is important information for airport managers and airlines to improve efficiency and customer satisfaction.
Data Visualization (Metrics III)
Do departure delays have a significant effect on arrival delays?
Based on this visualization, it can be concluded that there is a clear relationship between the day of the week and the level of flight delays:
This insight is valuable for airlines and passengers to better plan their schedules, anticipate potential delays, and improve overall operational efficiency and customer satisfaction by understanding and mitigating the patterns of delays throughout the week.
Data Visualization (Metrics IV)
Do flight delays occur more frequently on certain days of the week?
Based on the visualized graph, it can be concluded that airlines such as ExpressJet Airlines Inc, Frontier Airlines Inc, Southwest Airlines Co, and Mesa Airlines Inc tend to experience more flight delays in a year compared to other airlines. These airlines may need to make improvements in their operations to reduce delays and improve on-time departures.
Data Visualization (Metrics V)
What airlines have more flight delays in an average year?
Dashboard Tableau
Airline Performance Dashboard
Airline Performance Dashboard
Project Conclusions
After conducting a series of analyses and data visualizations, it is evident that flight delays peak in summer and winter due to high passenger volumes and adverse weather. Morning flights are generally more punctual than those in the afternoon and evening. Reducing departure delays significantly improves arrival punctuality. Mondays have the highest delays, while Saturdays have the lowest. Airlines like ExpressJet, Frontier, Southwest, and Mesa exhibit the highest delays. These findings are crucial for optimizing airline operations, planning passenger travel, and enhancing airport efficiency.
Project Conclusions
Link Sources
LINK GOOGLE COLAB
LINK Tableau Public
Thank You