1 of 11

Programming Basics for Logistics Algorithms:

Mini-project

Tatiana Polishchuk

Assistant Professor, 

Linköping University, KTS

www.itn.liu.se/~tatpo46/

1

2 of 11

2

HW5: Mini-project on Data Analysis

1. Download flight data for from the dataset alldelays.csv to access flight delays information provided by EUROCONTROL

2. Choose 2 research questions from the list and clearly state it

3. Extract the data you need for the corresponding airports/data periods from the dataset

4. Code the calculations to answer your research question

5. Illustrate the results using 2 different types of plots in Matlab

6. Send HW5 report to the examiner (Tatiana Polishchuk) in one email, containing:

  • Research question (from step 2)
  • Code covering the data extraction (step 3)
  • Code with calculations (step 4)
  • Code for two figures/plots created (step 5) and the figures in .jpeg or .png format attached

3 of 11

3

Advanced File Operations

EUROCONTROL Performance Review Unit (PRU): ATFM arrival flight delays

Data covers:

Years 2016-2024 (not much data for the pandemics years 2020-2021)

All European airports

4 of 11

4

Mini-project

EUROCONTROL Performance Review Unit (PRU): ATFM arrival flight delays

5 of 11

5

Advanced File Operations

Example: extract data subset from a data file

% clear Workspace

clear; clear all

% load flight delay data into the array variable delay_data

delay_data = readtable('alldelays.csv');

6 of 11

6

Advanced File Operations

Example: extract data subset corresponding for Munich airport

% extract delay data for the particular airport of Munich

flight_data = delay_data(strcmp(delay_data.APT_ICAO, 'EDDM'), :);

% save the delay data for Munich airport in a separate data file

writetable(flight_data, 'munich.csv');

7 of 11

7

Advanced File Operations

EUROCONTROL Performance Review Unit (PRU): ATFM arrival flight delays

Query examples: full list

  • What is the total number of flights delayed at Munich airport in the summer 2019?
  • What is the total amount of delays in minutes recorded at Munich airport in 2023?
  • For how many days in May 2023 the airport has experienced delays?
  • What were the main causes of Munich airport delays in 2024?
  • What is the share of the airport delays attributed to weather at Munich airport in 2023?
  • Compare the delay records (in total number of delayed flights and minutes of delays) at two airports of your choice, etc.

8 of 11

8

Advanced File Operations

Example: analyse the delays in Munich airport: code

% Clean the data to leave only the rows containing information about the delays

num_lines = size(flight_data,1)

count = 0;

for i=1:(num_lines-1)

if (flight_data.DLY_APT_ARR_1{i}>0)

count = count +1;

delay_data_clean(count,:) = flight_data(i,:);

end

end

writetable(delay_data_clean,'munich_delays.csv')

% now delay_data_clean contains only non-zero rows with delay information

% make calculations for the delays attributed to weather in Munich airport

9 of 11

9

Advanced File Operations

Example (cont.): analyse the delays in Munich airport code

% Calculate delays (in number of flights) Munich airport for all years

sum_delays = sum(delay_data_clean.FLT_ARR_1)

% Calculate delays (in minutes) attributed to weather in Munich airport for all years

delay_data_clean_double = readtable('munich_clean.csv');

sum_weather_delays = sum(delay_data_clean_double.DLY_APT_ARR_W_1)

! Note: the data cells corresponding to minutes of delays is stored in “string” format in the delay datatable. This type is not appropriate for operation of summation!

There are 2 ways to resolve:

-use casting operation per cell in a loop (it does not work for the whole column),

-or to make your life easy, open the datafile 'munich_delays.csv' (see previous slide) in Excel and format the corresponding column/cells to Number.

10 of 11

10

HW5: Mini-project on Data Analysis

EXAMPLE:

Fig1: Illustrate the proportions of different delay causes in airport of Munich in the year 2024

Fig2: Compare the impact of weather on delays at 3 airports for different years

Piechart: code Barplot: code

11 of 11

11

HW5: Mini-project on Data Analysis

*Tips: There are many plotting functions available in Matlab. Try different types, not only the ones I’ve showed in the example.

Very useful type of plotting statistics is boxplot (see an example below, but note that it does not correspond to the delay dataset).

Boxplot: code