{"id":4239,"date":"2024-12-30T08:04:21","date_gmt":"2024-12-29T23:04:21","guid":{"rendered":"https:\/\/secondlife.lol\/?p=4239"},"modified":"2024-12-30T08:27:46","modified_gmt":"2024-12-29T23:27:46","slug":"lessons-from-aviation-accidents-jeju-air-python","status":"publish","type":"post","link":"https:\/\/secondlife.lol\/en\/lessons-from-aviation-accidents-jeju-air-python\/","title":{"rendered":"Lessons from airplane crashes: A Python look back at the Jeju Air disaster"},"content":{"rendered":"<style>.kb-image4239_03b424-08 .kb-image-has-overlay:after{opacity:0.3;}<\/style>\n<div class=\"wp-block-kadence-image kb-image4239_03b424-08\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"600\" height=\"116\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/IMG_3844-600x116.jpeg\" alt=\"\" class=\"kb-img wp-image-4252\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/IMG_3844-600x116.jpeg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/IMG_3844-300x58.jpeg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/IMG_3844-768x148.jpeg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/IMG_3844-18x3.jpeg 18w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/IMG_3844.jpeg 934w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">On December 29, 2024, we were shocked by the tragic news of the Jeju Air crash. Our deepest condolences go out to the victims and their families at this difficult time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In honor of those who have lost their lives, this post is dedicated to analyzing and learning from aircraft accidents with data-driven insights. It is my hope that together we can reflect, learn, and build a safer future.<\/p>\n\n\n<style>.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title-wrap{padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title-wrap{color:var(--global-palette2, #2B6CB0);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{color:var(--global-palette2, #2B6CB0);font-size:28px;font-weight:regular;font-style:normal;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap .kb-table-of-content-list{color:var(--global-palette1, #3182CE);line-height:2em;font-weight:regular;font-style:normal;margin-top:var(--global-kb-spacing-sm, 1.5rem);margin-right:0px;margin-bottom:0px;margin-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap .kb-table-of-content-list .kb-table-of-contents__entry:hover{color:var(--global-palette6, #718096);}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);}}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{font-size:28px;}}@media all and (max-width: 767px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{font-size:28px;}}<\/style>\n\n\n<h2 class=\"wp-block-heading\">Aircraft accident data overview<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>Kaggle Aircraft Accident Dataset<\/strong>contains a wealth of information related to aviation accidents and is an important resource for data analysis and safety improvement research. Key features of the dataset include<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The dataset name is <strong>Aviation Accident Database Synopses<\/strong> To, <strong>U.S. National Transportation Safety Board (NTSB)<\/strong>'s aviation accident database. For reference, the detailed dataset can be found in the <a href=\"https:\/\/www.kaggle.com\/datasets\/khsamaha\/aviation-accident-database-synopses\" target=\"_blank\" rel=\"noopener\">Aviation Accident Database Synopses on Kaggle<\/a> for more information.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Kaggle Dataset Overview Summary<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-center\" data-align=\"center\"><strong>Item<\/strong><\/th><th class=\"has-text-align-left\" data-align=\"left\"><strong>Description.<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>Dataset name<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">Aviation Accident Database Synopses<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>Source<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">U.S. National Transportation Safety Board (NTSB)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>Licenses<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">CC0 1.0 Universal<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>Key columns<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">&#8211; <code>Event_Date<\/code>: Incident date<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td class=\"has-text-align-left\" data-align=\"left\">&#8211; <code>Location<\/code>, <code>Country<\/code>: Incident Location<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td class=\"has-text-align-left\" data-align=\"left\">&#8211; <code>Broad.phase.of.flight<\/code>: Flight Phase<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td class=\"has-text-align-left\" data-align=\"left\">&#8211; <code>Weather.Condition<\/code>: Weather conditions<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td class=\"has-text-align-left\" data-align=\"left\">&#8211; <code>Total.Fatal.Injuries<\/code>: Number of deaths<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><\/td><td class=\"has-text-align-left\" data-align=\"left\">&#8211; <code>Probable_Cause<\/code>: Incident Cause<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>Purpose of use<\/strong><\/td><td class=\"has-text-align-left\" data-align=\"left\">- Analyze incident trends, improve technology, and develop policies<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Dataset features<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>When and where incidents occur<\/strong>Visualize data by incident year and location to analyze patterns.<\/li>\n\n\n\n<li><strong>Incidents by flight phase<\/strong>: Identify trends in incidents during specific phases (e.g., landing, takeoff).<\/li>\n\n\n\n<li><strong>Scale of damage<\/strong>: Assess the severity of the incident through the number of fatalities, injuries, and survivors.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This dataset analyzes aircraft accidents and provides practical insights to prevent catastrophic events like airliner crashes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Analyzing Aircraft Accident Data with Python Visualizations<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/python.org\" target=\"_blank\" rel=\"noopener\">Python<\/a>is a versatile programming language that helps researchers and analysts discover insights within complex data sets. Analyzing aircraft accidents with Python visualizations can identify patterns and outliers for policy decisions and technical improvements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Below is a code snippet for visualizing aircraft accident data in Python. This analysis can help you gain a deeper understanding of trends that may have contributed to tragedies like the recent Jeju Air crash. The code is long, but we've broken it down to make it easier to understand in the code walkthrough in the concluding section.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Setting up the # Kaggle API and downloading data\n!pip install kaggle -q # Install the Kaggle library\nimport os\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport plotly.express as px\n\nSet up the # Kaggle API key\nos.environ['KAGGLE_CONFIG_DIR'] = '\/content' # Set to current directory\n!chmod 600 \/content\/kaggle.json # Set permissions\n\n# Download the Kaggle dataset\n!kaggle datasets download -d khsamaha\/aviation-accident-database-synopses -p \/content\/aviation_data --unzip\n\nLoad # data\nfile_path = \"\/content\/aviation_data\/AviationData.csv\"\ndf = pd.read_csv(file_path, encoding='ISO-8859-1', low_memory=False)\n\nVerify and correct the # column names\ndf.rename(columns={\"Event Date\": \"Event_Date\", \"Broad.phase.of.flight\": \"Phase_of_Flight\"}, inplace=True)\n\n# Convert dates and create years\ndf.rename(columns={'Event.Date': 'Event_Date'}, inplace=True)\ndf['Event_Date'] = pd.to_datetime(df['Event_Date'], errors='coerce')\ndf['Year'] = df['Event_Date'].dt.year\n\nRemove rows with # missing values\ndf = df.dropna(subset=['Phase_of_Flight'])\n\nCount the number of incidents per # phase of flight\nphase_counts = (\n    df.groupby(['Phase_of_Flight', 'Year'])\n    .size()\n    .reset_index(name='count')\n)\n\n# matplotlib default font setting (to avoid warnings)\nplt.rcParams['font.family'] = 'DejaVu Sans' # Fonts supported by default in Colab\n\n# 1. Total accidents by phase of flight (Bar Chart)\nplt.figure(figsize=(12, 6))\ntotal_by_phase = phase_counts.groupby('Phase_of_Flight')['count'].sum().sort_values()\nsns.barplot(x=total_by_phase.values, y=total_by_phase.index, palette='viridis')\nplt.title('Total Accidents by Phase of Flight')\nplt.xlabel('Number of Accidents')\nplt.ylabel('Phase of Flight')\nplt.tight_layout()\nplt.show()\n\n# 2. Annual accident trends by phase of flight (Line Chart)\nplt.figure(figsize=(15, 8))\nfor phase in phase_counts['Phase_of_Flight'].unique():\n    phase_data = phase_counts[phase_counts['Phase_of_Flight'] == phase]\n    plt.plot(phase_data['Year'], phase_data['count'], marker='o', label=phase)\n\nplt.title('Annual Accident Trends by Phase of Flight')\nplt.xlabel('Year')\nplt.ylabel('Number of Accidents')\nplt.legend(bbox_to_anchor=(1.05, 1), loc='upper left')\nplt.grid(True, alpha=0.3)\nplt.tight_layout()\nplt.show()\n\n# 3. Heatmap of accidents by year and phase of flight\npivot_data = phase_counts.pivot(index='Phase_of_Flight', columns='Year', values='count')\nplt.figure(figsize=(15, 8))\nsns.heatmap(pivot_data, cmap='viridis', cbar_kws={'label': 'Number of Accidents'})\nplt.title('Accidents by Year and Phase of Flight (Heatmap)')\nplt.xlabel('Year')\nplt.ylabel('Phase of Flight')\nplt.tight_layout()\nplt.show()\n\n# 4. Accident proportion by phase of flight (Last 10 years - Interactive Pie Chart)\nmax_year = df['Year'].max()\nrecent_data = df[df['Year'] &gt;= max_year - 10]\nrecent_counts = (\n    recent_data.groupby('Phase_of_Flight')\n    .size()\n    .reset_index(name='count')\n)\nrecent_counts['percentage'] = recent_counts['count'] \/ recent_counts['count'].sum() * 100\n\nfig = px.pie(\n    recent_counts,\n    values='percentage',\n    names='Phase_of_Flight',\n    title='Proportion of Accidents by Phase of Flight (Last 10 Years)',\n    color_discrete_sequence=px.colors.sequential.Viridis\n)\nfig.show()\n\n# 5. Monthly accident patterns (Line Chart)\ndf['Month'] = df['Event_Date'].dt.month\nmonthly_accidents = (\n    df.groupby(['Phase_of_Flight', 'Month'])\n    .size()\n    .reset_index(name='count')\n)\n\nplt.figure(figsize=(15, 8))\nsns.lineplot(data=monthly_accidents, x='Month', y='count',\n             hue='Phase_of_Flight', marker='o')\nplt.title('Monthly Accident Patterns by Phase of Flight')\nplt.xlabel('Month')\nplt.ylabel('Number of Accidents')\nplt.grid(True, alpha=0.3)\nplt.tight_layout()\nplt.show()\n\n# basic statistics output\nsummary_stats = (\n    phase_counts.groupby('Phase_of_Flight')\n    .agg({'count': ['mean', 'std', 'min', 'max']})\n    .round(2)\n)\nprint(\"\\n=== Summary Statistics for Accidents by Phase of Flight ===\")\nprint(summary_stats)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Analyze and derive insights<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">1. Total Accidents by Phase of Flight (Bar Chart)<\/h4>\n\n\n<style>.kb-image4239_e7e142-19 .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image4239_e7e142-19 img.kb-img, .kb-image4239_e7e142-19 .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image4239_e7e142-19\"><figure class=\"aligncenter size-medium_large\"><img decoding=\"async\" width=\"768\" height=\"381\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-5-768x381.jpg\" alt=\"\ud56d\uacf5\uae30 \uc0ac\uace0 \ub9c9\ub300\uadf8\ub798\ud504 \uc774\ubbf8\uc9c0\" class=\"kb-img wp-image-4240\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-5-768x381.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-5-300x149.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-5-600x298.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-5-18x9.jpg 18w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-5.jpg 1188w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Interpretation: Most incidents are caused by <code>Landing<\/code>(landing) and <code>Takeoff<\/code>(takeoff) phase, indicating that this is the most critical phase in airline operations. Relatively speaking <code>Other<\/code>, <code>Unknown<\/code>, and <code>Standing<\/code> The frequency of incidents is very low in the phase.<\/li>\n\n\n\n<li>Insights:\n<ul class=\"wp-block-list\">\n<li>The landing and takeoff phases rely heavily on collaboration between pilots and air traffic controllers, the performance of the aircraft, weather conditions, and more, so safety measures are critical.<\/li>\n\n\n\n<li><code>Cruise<\/code> Although the stage is altitude maintained and stable, it has the third highest accident rate and needs improvement here as well.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2. Annual Accident Trends by Phase of Flight (Line Chart)<\/h4>\n\n\n<style>.kb-image4239_6f8d1b-47 .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image4239_6f8d1b-47 img.kb-img, .kb-image4239_6f8d1b-47 .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image4239_6f8d1b-47\"><figure class=\"aligncenter size-medium_large\"><img decoding=\"async\" width=\"768\" height=\"406\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-6-768x406.jpg\" alt=\"\ud56d\uacf5\uae30 \uc0ac\uace0 \ub77c\uc778\uadf8\ub798\ud504 \uc774\ubbf8\uc9c0\" class=\"kb-img wp-image-4241\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-6-768x406.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-6-300x159.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-6-600x318.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-6-18x10.jpg 18w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-6.jpg 1200w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Interpretation: Overall incidents are trending downward over time, particularly for the <code>Cruise<\/code>and <code>Landing<\/code>the reduction in incidents is significant.<\/li>\n\n\n\n<li>Insights:\n<ul class=\"wp-block-list\">\n<li>Advances in aircraft technology, stricter regulations, and improved training programs are likely the main culprits.<\/li>\n\n\n\n<li>A spike in incidents in a given year may be related to events in that year or to specific technical\/environmental factors.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">3. Heatmap of Accidents by Year and Phase of Flight<\/h4>\n\n\n<style>.kb-image4239_5ba1f0-dc .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image4239_5ba1f0-dc img.kb-img, .kb-image4239_5ba1f0-dc .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image4239_5ba1f0-dc\"><figure class=\"aligncenter size-medium_large\"><img decoding=\"async\" width=\"768\" height=\"440\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-7-768x440.jpg\" alt=\"\ud56d\uacf5\uae30 \uc0ac\uace0 \ud788\ud2b8\ub9f5 \uc774\ubbf8\uc9c0\" class=\"kb-img wp-image-4242\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-7-768x440.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-7-300x172.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-7-600x344.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-7-18x10.jpg 18w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-7.jpg 1200w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Interpretation: Landing (<code>Landing<\/code>) and takeoff (<code>Takeoff<\/code>) stage, a high frequency of incidents is observed across all years. For a given year's <code>Approach<\/code>and <code>Cruise<\/code> Thinking in steps is also noticeable.<\/li>\n\n\n\n<li>Insights:\n<ul class=\"wp-block-list\">\n<li>The landing and takeoff phases are consistently categorized as high-risk.<\/li>\n\n\n\n<li>Patterns that are concentrated in a particular year may be related to seasonal, regional, or operational factors.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">4. Accident Proportion by Phase of Flight (Last 10 Years - Pie Chart)<\/h4>\n\n\n<style>.kb-image4239_735e79-5f .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image4239_735e79-5f img.kb-img, .kb-image4239_735e79-5f .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image4239_735e79-5f\"><figure class=\"aligncenter size-medium_large\"><img decoding=\"async\" width=\"768\" height=\"444\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-8-768x444.jpg\" alt=\"\ud56d\uacf5\uae30 \uc0ac\uace0 \ud30c\uc774\ucc28\ud2b8 \uc774\ubbf8\uc9c0\" class=\"kb-img wp-image-4243\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-8-768x444.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-8-300x173.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-8-600x347.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-8-18x10.jpg 18w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-8.jpg 798w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Interpretation: The percentage of incidents over the last 10 years is <code>Landing<\/code>is the highest, <code>Takeoff<\/code>and <code>Cruise<\/code>followed by The remaining phases have relatively low percentages.<\/li>\n\n\n\n<li>Insights:\n<ul class=\"wp-block-list\">\n<li>The landing and takeoff phases suggest the need to further strengthen accident prevention measures.<\/li>\n\n\n\n<li><code>Cruise<\/code> Incidents in stages still need to be noted, and causes such as technical issues (e.g. engine failure) need to be analyzed.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">5. Monthly Accident Patterns by Phase of Flight (Line Chart)<\/h4>\n\n\n<style>.kb-image4239_00cbc5-6e .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image4239_00cbc5-6e img.kb-img, .kb-image4239_00cbc5-6e .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image4239_00cbc5-6e\"><figure class=\"aligncenter size-medium_large\"><img decoding=\"async\" width=\"768\" height=\"408\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-9-768x408.jpg\" alt=\"\ud56d\uacf5\uae30 \uc0ac\uace0 \ub77c\uc778\ucc28\ud2b8 \uc774\ubbf8\uc9c02\" class=\"kb-img wp-image-4244\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-9-768x408.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-9-300x159.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-9-600x319.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-9-18x10.jpg 18w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-9.jpg 1200w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Interpretation: <code>Landing<\/code>and <code>Takeoff<\/code> phase, the number of accidents tends to increase during the summer months (June through August). This may be related to the increase in aircraft operations during the summer months.<\/li>\n\n\n\n<li>Insights:\n<ul class=\"wp-block-list\">\n<li>Increased air traffic during the summer months increases the likelihood of accidents.<\/li>\n\n\n\n<li>Additional maintenance and training programs should be ramped up to reduce the seasonal impact.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">6. Summary Statistics for Accidents by Phase of Flight<\/h4>\n\n\n<style>.kb-image4239_f35162-8e .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image4239_f35162-8e img.kb-img, .kb-image4239_f35162-8e .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image4239_f35162-8e\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"499\" height=\"317\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-10.jpg\" alt=\"\ud56d\uacf5\uae30 \uc0ac\uace0 \uc694\uc57d \ud1b5\uacc4 \uc774\ubbf8\uc9c0\" class=\"kb-img wp-image-4245\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-10.jpg 499w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-10-300x191.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-3-10-18x12.jpg 18w\" sizes=\"(max-width: 499px) 100vw, 499px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Interpretation: <code>Landing<\/code> Stage has the highest average number of incidents (593.38), a large standard deviation (129.93), and high variability with a maximum value (472).<\/li>\n\n\n\n<li>Insights:\n<ul class=\"wp-block-list\">\n<li>The number of accidents during the landing phase varies, indicating that it is highly influenced by conditions (weather, pilot skill, etc.).<\/li>\n\n\n\n<li>Takeoff (<code>Takeoff<\/code>) and adherence to standardized procedures during the landing phase are key to reducing accidents.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Comprehensive insights<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Improved focus on landing and takeoff phases<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The data clearly shows that accidents are concentrated during the landing and takeoff phases. To address this, pilots need to be better trained and aircraft health checks need to be more thorough.<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Need to analyze seasonality<\/strong>: Considering the increase in accidents during the summer months, seasonal precautions should be increased.<\/li>\n\n\n\n<li><strong>Need to keep improving technology<\/strong>: <code>Cruise<\/code> Research and investment in solving technical problems on long flight segments, such as stages, is important.<\/li>\n\n\n\n<li><strong>Dive into specific years\/stages of data<\/strong>: It is necessary to analyze accidents concentrated in a particular year to examine aircraft models, operating procedures, and external factors.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Python Code Explained<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Installing and importing libraries<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!pip install kaggle -q # Install the Kaggle library\nimport os\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nimport plotly.express as px<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In this section, you will install and import the required libraries. Install the kaggle library to use the Kaggle API, and import the pandas, seaborn, matplotlib, and plotly libraries for data analysis and visualization.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Setting up the Kaggle API<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>os.environ['KAGGLE_CONFIG_DIR'] = '\/content' # Set to current directory\n!chmod 600 \/content\/kaggle.json Set # permissions<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Set up environment variables to use the Kaggle API, and set permissions for the API key file (kaggle.json).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Downloading and loading data<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>!kaggle datasets download -d khsamaha\/aviation-accident-database-synopses -p \/content\/aviation_data --unzip\n\nfile_path = \"\/content\/aviation_data\/AviationData.csv\"\ndf = pd.read_csv(file_path, encoding='ISO-8859-1', low_memory=False)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Download and unzip the dataset using the Kaggle API. Then load the CSV file into a dataframe using pandas.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Data preprocessing<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>df.rename(columns={\"Event Date\": \"Event_Date\", \"Broad.phase.of.flight\": \"Phase_of_Flight\"}, inplace=True)\ndf['Event_Date'] = pd.to_datetime(df['Event_Date'], errors='coerce')\ndf['Year'] = df['Event_Date'].dt.year\ndf = df.dropna(subset=['Phase_of_Flight'])<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Rename columns, convert date data to datetime format, add a 'Year' column, and remove rows with missing values.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Data aggregation<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>phase_counts = (\n    df.groupby(['Phase_of_Flight', 'Year'])\n    .size()\n    .reset_index(name='count')\n)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Aggregate the number of incidents by operational phase and year.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Python visualization<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Total number of incidents per flight phase (<a href=\"https:\/\/secondlife.lol\/en\/categorical-barplot-python\/\" data-type=\"post\" data-id=\"4041\">Bar charts<\/a>)<\/li>\n\n\n\n<li>Annual accident trends by operational phase (<a href=\"https:\/\/secondlife.lol\/en\/python-visualization-dual-axis-chart-guide\/\" data-type=\"post\" data-id=\"4097\">Line graphs<\/a>)<\/li>\n\n\n\n<li>Incident heatmap by year and operational phase<\/li>\n\n\n\n<li>Accident rates by operational phase over the last 10 years (interactive pie chart)<\/li>\n\n\n\n<li>Incident patterns by month (line graph)<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">For each visualization, choose the appropriate graph type and implement it using matplotlib, seaborn, or plotly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Basic statistics output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>summary_stats = (\n    phase_counts.groupby('Phase_of_Flight')\n    .agg({'count': ['mean', 'std', 'min', 'max']})\n    .round(2)\n)\nprint(\"\\n=== Summary Statistics for Accidents by Phase of Flight ===\")\nprint(summary_stats)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Calculate and output basic statistics (mean, standard deviation, minimum, maximum) for the number of incidents per flight phase.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Recapping - Mourning and Vigilance in the Jeju Air Crash<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Jeju Air crash is a heartbreaking aviation tragedy. It is right that the whole nation should mourn, and at the same time, we should thoroughly analyze the causes and take countermeasures. In addition, I think we all need to keep an eye on this tragedy so that it is not used for political purposes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Utilizing tools like Python can provide insight into identifying risks and implementing solutions that can save lives. As we mourn this tragedy, we need the nation's attention to make our skies safer. We hope this analysis of aircraft accident data is a small step on that journey.<\/p>","protected":false},"excerpt":{"rendered":"<p>2024\ub144 12\uc6d4 29\uc77c \uc6b0\ub9ac\ub294 \uc81c\uc8fc\ud56d\uacf5 \uc0ac\uace0\ub77c\ub294 \ube44\uadf9\uc801\uc778 \uc18c\uc2dd\uc5d0 \ucda9\uaca9\uc744 \ubc1b\uc558\uc2b5\ub2c8\ub2e4&#8230;.<\/p>","protected":false},"author":3,"featured_media":4247,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[3],"tags":[684,686,688,500,682,685,689,687,683],"class_list":["post-4239","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python-coding","tag-684","tag-686","tag-688","tag-500","tag-682","tag-685","tag-689","tag-687","tag-683"],"taxonomy_info":{"category":[{"value":3,"label":"\ud30c\uc774\uc36c(Python)"}],"post_tag":[{"value":684,"label":"\uc81c\uc8fc\ud56d\uacf5 \ubd84\uc11d"},{"value":686,"label":"\uc81c\uc8fc\ud56d\uacf5 \uc0ac\uace0"},{"value":688,"label":"\ud30c\uc774\uc36c \ub370\uc774\ud130 \ubd84\uc11d"},{"value":500,"label":"\ud30c\uc774\uc36c \ucf54\ub529"},{"value":682,"label":"\ud56d\uacf5"},{"value":685,"label":"\ud56d\uacf5 \uc548\uc804"},{"value":689,"label":"\ud56d\uacf5 \uc778\uc0ac\uc774\ud2b8"},{"value":687,"label":"\ud56d\uacf5\uae30 \uacbd\ud5a5"},{"value":683,"label":"\ud56d\uacf5\uae30 \uc0ac\uace0"}]},"featured_image_src_large":["https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/\ud56d\uacf5\uae30-\uc0ac\uace0-\ub370\uc774\ud130-\ubd84\uc11d-\ud3ec\uc2a4\ud2b8-\uc378\ub124\uc77c-600x600.jpg",600,600,true],"author_info":{"display_name":"TERE","author_link":"https:\/\/secondlife.lol\/en\/author\/tere\/"},"comment_info":0,"category_info":[{"term_id":3,"name":"\ud30c\uc774\uc36c(Python)","slug":"python-coding","term_group":0,"term_taxonomy_id":3,"taxonomy":"category","description":"","parent":20,"count":119,"filter":"raw","cat_ID":3,"category_count":119,"category_description":"","cat_name":"\ud30c\uc774\uc36c(Python)","category_nicename":"python-coding","category_parent":20}],"tag_info":[{"term_id":684,"name":"\uc81c\uc8fc\ud56d\uacf5 \ubd84\uc11d","slug":"%ec%a0%9c%ec%a3%bc%ed%95%ad%ea%b3%b5-%eb%b6%84%ec%84%9d","term_group":0,"term_taxonomy_id":684,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":686,"name":"\uc81c\uc8fc\ud56d\uacf5 \uc0ac\uace0","slug":"%ec%a0%9c%ec%a3%bc%ed%95%ad%ea%b3%b5-%ec%82%ac%ea%b3%a0","term_group":0,"term_taxonomy_id":686,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":688,"name":"\ud30c\uc774\uc36c \ub370\uc774\ud130 \ubd84\uc11d","slug":"%ed%8c%8c%ec%9d%b4%ec%8d%ac-%eb%8d%b0%ec%9d%b4%ed%84%b0-%eb%b6%84%ec%84%9d","term_group":0,"term_taxonomy_id":688,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":500,"name":"\ud30c\uc774\uc36c \ucf54\ub529","slug":"%ed%8c%8c%ec%9d%b4%ec%8d%ac-%ec%bd%94%eb%94%a9","term_group":0,"term_taxonomy_id":500,"taxonomy":"post_tag","description":"","parent":0,"count":3,"filter":"raw"},{"term_id":682,"name":"\ud56d\uacf5","slug":"%ed%95%ad%ea%b3%b5","term_group":0,"term_taxonomy_id":682,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":685,"name":"\ud56d\uacf5 \uc548\uc804","slug":"%ed%95%ad%ea%b3%b5-%ec%95%88%ec%a0%84","term_group":0,"term_taxonomy_id":685,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":689,"name":"\ud56d\uacf5 \uc778\uc0ac\uc774\ud2b8","slug":"%ed%95%ad%ea%b3%b5-%ec%9d%b8%ec%82%ac%ec%9d%b4%ed%8a%b8","term_group":0,"term_taxonomy_id":689,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":687,"name":"\ud56d\uacf5\uae30 \uacbd\ud5a5","slug":"%ed%95%ad%ea%b3%b5%ea%b8%b0-%ea%b2%bd%ed%96%a5","term_group":0,"term_taxonomy_id":687,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":683,"name":"\ud56d\uacf5\uae30 \uc0ac\uace0","slug":"%ed%95%ad%ea%b3%b5%ea%b8%b0-%ec%82%ac%ea%b3%a0","term_group":0,"term_taxonomy_id":683,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/posts\/4239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/comments?post=4239"}],"version-history":[{"count":9,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/posts\/4239\/revisions"}],"predecessor-version":[{"id":4257,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/posts\/4239\/revisions\/4257"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/media\/4247"}],"wp:attachment":[{"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/media?parent=4239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/categories?post=4239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/tags?post=4239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}