본문 바로가기
Data/Data Analystics

[데이터 분석] 정말 비행기가 가장 안전한 교통 수단일까? 2. 데이터 전처리

by DenverAlmighty 2024. 12. 30.

이전 글

[데이터 분석] 정말 비행기가 가장 안전한 교통 수단일까?  0. 분석 계기

[데이터 분석] 정말 비행기가 가장 안전한 교통 수단일까? 1. 데이터 수집


ASN_Safety_Database.csv

crawler_asn_data.py 로 수집한 항공 사고 요약 데이터이다.

데이터는 사고 날짜(acc. date), 기종(type), 항공편명(reg.), 항공사(operator), 사망자 수(fat), 사고 위치(location), 데미지(dmg) 컬럼이 있다. 

 

우선 필드명에 기호 '.'와 공백이 들어가므로 변경하면 좋을거같다.

그리고 type은 제조사 + 기종인거같은데 이거도 분리하면 분석에 더 용아할 것이다.

location 필드에 '횜stan책' 이런 이상한 값이 있는데, 국가 기호 때문인 것 같다. 이거를 제거해야하고

location이 ~공항, 어디서 몇키로 지점, 지역명등 다양하게 표시되어있는데 데이터를 더 살펴봐야겠지만 공항, 지명, 공항 근처, 지명 근처 등등으로 표시되어있다.

필요하다면 [공항, 공항 근처, 이외 장소] 혹은 [도착지 근처, 출발지 근처, 이외 장소]  등등으로 변환해도 좋을 것 같다.

acc. date type reg. operator fat. location dmg
2.Aug.19 Caproni Ca.48   Caproni 14 Verona w/o
11.Aug.19 Felixstowe Fury N123 Royal Air Force - RAF 1 off Felixtowe RNAS w/o
23.Feb.20 Handley Page O/7 G-EANV Handley Page Transport 0 Acadia Siding, Cape Province w/o
25.Feb.20 Handley Page O/40 0 G-EAMC Handley Page Transport 0 10 km N of El Shereik w/o
30.Jun.20 Handley Page O/400 G-EAKE Handley Page Transport 0 횜stan책 w/o
      ...      
25.Dec.24 Embraer ERJ-190AR 4K-AZ65 Azerbaijan Airlines 38 5 km NW of Aktau Airport (SCO/UATE) w/o
28.Dec.24 Bombardier DHC-8-402Q Dash 8 C-GPNA Air Canada Express, opb PAL Airlines 0 Halifax Stanfield International Airport (YHZ/CYHZ) sub
29.Dec.24 Boeing 737-8AS (WL) HL8088 Jeju Air 179 Muan International Airport (MWX/RKJB) w/o
변경 전 필드명 한글 필드명 변경 후 필드명
acc. date 사고 날짜 acc_date
type 기종 type
  제조사 manufacturer
reg. 항공편명 registration
operator 항공사 operator
fat. 사망자 fatalities
location 위치 location
dmg 손상 dmg

 

 

 

ASN_Safety_Database_detail_{yyyy}.csv

 

crawler_asn_data_detail.py 로 수집한 항공 사고 요약 데이터이다. (컬럼이 너무 많아서 둘로 나눴다)

데이터는 사고 날짜(Date), 시간(Time) 기종(type), 소유자/항공사(Owner/operator), 항공편명(Registration), 제조 년도(Year of manufacture), 사상자(Fatalities), 출방 공항(Departure airport), 도착 공항(Destination airport) 등의 컬럼이 있다. 

 

필드명에 ":"을 제거해야하고, 대문자를 소문자로 변환한다,

이 데이터에도 location 필드에 기호 아이콘이 어그러져 "혻" 같은 값이 들어가있는데 제거한다.

Fatalities 필드에 Fatalities: 0 / Occupants: 0,0 이런식으로 되어있는데 탑승자 Occupants를 새 필드로 만들어야겠다.

Nature 필드의 값을 보면 Passenger - Scheduled(승객 - 예약됨), Passenger - Non-Scheduled/charter/Air Taxi(승객 - 비예약/전세기/항공 택시),  Military(군사용), Demo/Airshow/Display(데모/에어쇼/디스플레이), Ferry/positioning(인도, 위치 이동 등을 위한), Executive(경영진?) 이 있다. 이 중에서 Passenger 인 데이터만 필요하다.

null 값도 처리해야한다.

 

Date: Time: Type: Owner/operator: Registration: MSN: Year of manufacture: Fatalities: Other fatalities:
Monday 2 January 1984   CASA C-212-A3 Aviocar 100 Royal Jordanian Air Force - RJAF 325 55 1976 Fatalities: 13 / Occupants: 13 0
Monday 2 January 1984 22:30 LT Beechcraft 99 Britt Airways N317VA U72   Fatalities: 0 / Occupants: 11 0
Monday 9 January 1984 22:32 Douglas C-47B-20-DK (DC-3) Skycraft Air Transport C-GSCA 27190/15745 1945 Fatalities: 1 / Occupants: 2 0
Tuesday 10 January 1984 19:38 Tupolev Tu-134A Balkan Bulgarian Airlines LZ-TUR 4352308 1974 Fatalities: 50 / Occupants: 50 0
Saturday 29 December 1984   Lockheed L-100-30 Hercules Transamerica Airlines N24ST 4101 1965 Fatalities: 0 / Occupants: 20 0
Sunday 30 December 1984   McDonnell Douglas DC-9-32 Garuda Indonesia Airways PK-GNI 47636/758 1974 Fatalities: 0 / Occupants: 75 0
Monday 31 December 1984   McDonnell Douglas DC-10 American Airlines       Fatalities: 0 / Occupants: 198 0
unk. date 1984   Tupolev Tu-134A Aeroflot / Belarus CCCP-65095 60256 1978 Fatalities: 0 / Occupants: 0 0
unk. date 1984   Douglas DC-6A/B Unknown HP-1018 45131/797 1957 Fatalities:  / Occupants: 0
unk. date 1984   Douglas C-47D (DC-3) Aerolineas La Paz CP-1417 26804/15359 1944 Fatalities:  / Occupants: 0

 

 

Aircraft damage: Category: Location: Phase: Nature: Departure airport: Destination airport: Total airframe hrs: Engine model: Investigating agency: Confidence Rating: Cycles:
Destroyed, written off Accident near Al Qatrana -
혻 Jordan
En route Military              
Substantial Accident Galesburg, IL -
혻 United States of America
Taxi Unknown   Sterling, IL (SQ1) 31687 hours U/A CANADA PT6A-20 NTSB Accident investigation report completed and information captured  
Substantial, written off Accident Saint Louis-Lambert International Airport, MO (STL) -
혻 United States of America
Initial climb Cargo Saint Louis-Lambert International Airport, MO (STL/KSTL) Toronto-Pearson International Airport, ON (YYZ/CYYZ) 17933 hours Pratt & Whitney R-1830 NTSB Accident investigation report completed and information captured  
Destroyed, written off Accident 4 km from Sofia-Vrazhdebna Airport (SOF) -
혻 Bulgaria
Approach Passenger - Scheduled Berlin-Sch철nefeld Airport (SXF/EDDB) Sofia-Vrazhdebna Airport (SOF/LBSF)          
Destroyed, written off Accident Cafunfo Airport (CFF) -
혻 Angola
Standing Unknown       Allison 501-D22A      
Destroyed, written off Accident Denpasar Bali-Ngurah Rai Airport (DPS) -
혻 Indonesia
Landing Passenger - Scheduled Yogyakarta-Adisutjipto Airport (JOG/WARJ) Denpasar-Ngurah Rai Bali International Airport (DPS/WADD)   Pratt & Whitney JT8D-9      
None Unlawful Interference Havana-Jos챕 Mart챠 International Airport (HAV) -
혻 Cuba
En route Passenger - Scheduled Saint Croix-Alexander Hamilton Airport (STX/TISX) New York-John F. Kennedy International Airport, NY (JFK/KJFK)          
Destroyed, written off Other Minsk-1 International Airport (MHP) -
혻 Belarus
Standing -              
Destroyed, written off UK -
혻 Bahamas
Unknown Unknown           Little or no information is available  
Destroyed, written off Accident -
혻 Unknown country
Unknown Unknown           Little or no information is available  
변환 전 필드명 한글 필드명 변환 후 필드명
Date: 날짜 date
Time: 시간을 time
Type: 유형 type
  제조사 manufacturer
Owner/operator: 소유자/운항사 operator
Registration: 등록. registration
MSN: MSN msn
Year of manufacture: 제조 연도 year of manufacture
Fatalities: 사망자 수 fatalities
    occupants
Other fatalities: 기타 사망자 수 other fatalities
Aircraft damage: 항공기 손상 aircraft damage
Category: 카테고리 category
Location: 위치 location
Phase: 단계 phase
Nature: 자연. nature
Departure airport: 출발 공항 departure airport
Destination airport: 목적지 공항 destination airport
Total airframe hrs: 총 비행 시간 total airframe hrs
Engine model: 엔진 모델 engine model
Investigating agency: 조사 기관 investigating agency
Confidence Rating: 신뢰도 등급 confidence rating
Cycles: 주기 cycles

 

 

 

 

#무안 #무안공항 #제주항공  #제주항공무안공항참사


이전 글

[데이터 분석] 정말 비행기가 가장 안전한 교통 수단일까?  0. 분석 계기

[데이터 분석] 정말 비행기가 가장 안전한 교통 수단일까? 1. 데이터 수집