Week 4 Assignment: Using Plotly for Data Visualization
Overview. In this assignment, you will practice discovering and communicating insights about a
set of data by generating a report containing graphical visualizations of that data. This report will
challenge you to apply many of the skills you’ve acquired thus far towards independently
interpreting data, including data structuring, exploration, analysis, and presentation.
Goal. By completing this assignment, you will practice and master the following skills:
• Producing data visualizations using the Plotly library or others
• Wrangling multiple data sets of different shapes for specific analyses
• Exploring and drawing conclusions from data
• Learning and utilizing external libraries
Dataset—Airline Delay Causes. You are provided with a data file consisting of on-time-
statistics for airlines in the United States. This data set is freely available from The U.S.
Department of Transportations: [Link] A
copy of the data containing entries ranging from Feb 2009 – Feb 2019 is provided:
data/[Link]
Delays can be categorized into:
• Air Carrier. The cause was within the airline's control (e.g. maintenance or crew
problems, aircraft cleaning, baggage loading, fueling, etc.).
• Extreme Weather such as tornado, blizzard or hurricane.
• National Aviation System (NAS) which refers to a broad set of conditions, such as non-
extreme weather conditions, airport operations, heavy traffic volume, and air traffic
control.
• Late-arriving aircraft where a previous flight with same aircraft arrived late, causing
the present flight to depart late.
• Security caused by evacuation of a terminal or concourse, re-boarding of aircraft because
of security breach, inoperative screening equipment and/or long lines in excess of 29
minutes at screening areas.
For more details, see RITA -Understanding flight delays and cancellations:
([Link]
and-cancellations)
Each entry in the airline delay database represents the aggregate monthly data for a particular
airline at a particular airport. For example, one entry might be the delay information for
Southwest Airlines at St. Louis Airport during December 2013.
Also, each entry lists the number of flights, the number of flights delayed (15 minutes beyond the
scheduled arrival time), the number of flights canceled and diverted, the minutes of delay due to
carrier delay, weather delay, national air system delays, security delay. The _ct fields list the
count of flights experiencing each delay (they add up the arr_del15 column). Because a flight can
have multiple delay types, these numbers are real numbers. For example, if a flight was 30
minutes late, 15 minutes due to weather and 15 minutes due to security it will contribute .5 to
weather_ct and .5 to security_ct. It will also contribute 15 to the weather_delay field and 15 to
the security_delay field.
Finally, the arr_delay column is the sum of total delay minutes for the document (i.e., arr_delay
= carrier_delay+ weather_delay + nas_delay + security_delay + late_aircraft_delay)
The names of each field in an entry:
Label/field name Meaning
year The year the month occurred
month The month for which data was collected
carrier The airline code
carrier_name The airline name
airport The airport code
airport_name The airport name
arr_flights # of flights that arrived at the airport
arr_del15 # of flights that arrived >= 15 minutes late
carrier_ct # of flights delayed due to the carrier
weather_ct # of flights delayed due to weather
nas_ct # of flights delayed due to national air system
security_ct # of flights delayed due to security
late_aircraft_ct # flights delayed because a previous flight using the same aircraft was late
arr_cancelled # of canceled arrivals
arr_diverted # of scheduled arrivals that were diverted
arr_delay Sum of the delay minutes
carrier_delay Total minutes of delays due to carriers
weather_delay Total minutes of delays due to weather
nas_delay Total minutes of delays due to natl. air service
security_delay Total minutes of delays due to security
Similar to late_aircraft_ct. The total minutes of delay due to a previous
late_aircraft_delay
flight using the same aircraft arriving late.
This is an open-ended assignment requiring your critical thinking skills. Be ready to explore,
experiment, and program on your own! You can visualize the flight delay data with maps, bar
charts, line charts, scatterplots, and many others.
Some guidance questions include:
• Which airline should you fly on to avoid significant delays?
• Which months should you fly on to avoid significant delays?
• Any relationships between seasons and flight delays?
• Which region of airport has the most significant number of delays?
• What is the major reasons for delay?
Submission.
You should work individually on this assignment.
Turn in one zip file with the following components:
• Images of the visualizations (.png or .jpg)
• Your code (with any text editor in the format of .py or .ipynb so others can run your code
and see the interactivity).
The Rubric. We thought it might be helpful to have some sort of guidance when reviewing
everyone’s data visualization. The rubric is based on effectiveness on three areas: coding,
presentation, and storytelling.
When grading, you do not need to respond to every point in the rubric, but instead use the rubric
as a guideline for the peer review.
Rubric
We’d like you to assign numerical scores (from 1-5) for each of these questions. Full score is 50.
Needs work: 1 2 Satisfactory: 3 4 Excellent: 5
Coding
Coding style Many errors in coding style, Coding style lacks refinement and Student has gone beyond what was
little attention paid to has some errors, but code is expected and required, coding manual is
making the code human readable and has some comments followed, code is well commented
readable
Coding strategy Code tackles complicated Code is correct, but could be Complicated problem broken down into
problem in one big chunk. edited down to leaner code. Some sub-problems that are individually much
Code is repetitive and could "hacking" instead of using suitable simpler. Code is efficient, correct, and
easily be functionalized. No data structure. Some checks for minimal. Code uses appropriate data
anticipation of errors. errors. structure (list, data frame,
vector/matrix/array). Code checks for
common errors
Presentation
Graph type Graph(s) poorly chosen to Graph(s) well chosen, but with a Graph(s) carefully tuned for desired
support questions. few minor problems: inappropriate purpose. One graph illustrates one point
aspect ratios, poor labels.
Grouping and Difficult to find groups, The visualizations show attempts Gestalt and preattentive processing
Search follow lines, etc. Elements to convey information about the features are chosen to ease task (find
to be compared are not data through gestalt and important groups, follow lines, etc.)
aligned. Distinct variables preattentive processing features. Elements to be compared are aligned, as
are mapped to integral But could be made more so. much as possible. Distinct variables are
dimensions (e.g. point width mapped to separable dimensions. Choice
and height). Distinct of colors, shapes, etc. is easy to
elements cannot be discriminate.
discriminated.
Annotation and No message, or message is Simplistic but clear message. Text The visualizations include titles,
textual not at all supported by text and graphs support the message appropriate labeling, textual summaries.
summaries and graphs adequately Navigation is guided.
The visualizations are
Difficult to navigate and Clear, multifaceted message. Titles,
interpret, cluttered/ labeling, textual summaries,and
complicated. annotations are used to support the
message strongly.
Color and Font Poor Contrast (colors or Effective use of either Contrast or Shows strong use of principles of
fonts are not clearly Repetition, though not both. Contrast and Repetition: limited color
distinguished, or are not palette and font choices convey structure
used to provide and unity.
structure)and poor
Repetition (too many
different colors or fonts, and
do not convey unity).
Layout Poor Alignment (elements Effective use of either Alignment Shows strong use of principles of
are placed haphazardly)and or Proximity, though not both. Alignment and Proximity: bold
poor Proximity (no obvious Alignment is adequate within alignment guides reader through the
grouping ofelements or sections of graphic, but not across graphic; proximity groups related
separation of groups; them. elements together and separates distinct
unclear whichcaptions groups.
match which text/graphs).
Storytelling
Informative Graph highlights no Graph highlights some interesting Graph clearly highlights any trend or
interesting or useful pattern. or useful pattern but readers have pattern in the data, which is indicated in
Pattern is not indicated in to mentally compute differences the title and described in the writeup.
title or not described in write instead of seeing them directly.
up. Readers have to Interesting differences or comparisons
mentally compute are plotted directly
differences instead of seeing
them directly.
Comprehensible Graphic has no (or unclear) Graphic has a clear title, axis Graphic has an informative title, axis
title, axis labels, or legend. labels, or legend, but axis ticks are labels, and legend(if relevant). Axis ticks
Axis ticks are unmarked or unmarked or are marked at are labeled with sensible, round
are marked at arbitrary, arbitrary, unhelpful numbers. numbers.
unhelpful numbers.
Other Poor craftsmanship with Shows good craftsmanship and use Shows decent craftsmanship on
many imperfections. Does of computer layout. Cites all data computer layout, with minor
not cite data sources. sources. imperfections. Cites data sources.