Go to content ALT+c

Quantitative Applications for Data Analysis  (Winter 2017) (Old site; new site is at https://scinet.courses)
Registration is closed

Friday May 31, 2024 - 16:01

5.11 Make-up Assignment

Due date: Monday, April 10th at midnight (Monday night).


0) Be sure to use version control ("git"), as you develop your script. Start by creating a new repository for this assignment! Then follow the usual sequence of "git add ...., git commit" repeatedly as you add to your scripts. You will hand in the output of "git log" for your assignment repository as part of the assignment. 


Consider the dataset of airline routes described here, which can be downloaded from tinyurl.com/UTSC-Makeup . This dataset contains a list of flights between airports around the world.

Create a Python script which performs the following:

  1. Downloads the data, from the internet, and puts it into a data frame.
  2. Filters out non-direct flights.
  3. The script should accept 2 arguments.  The arguments to be given the script are starting and ending airport codes.  Your code should double check the number of arguments, and confirm that the airport codes given as arguments are in the list of airports in the data set (not all global airports are present).
  4. Creates a network, using the networkx package, consisting of the starting and ending airports in the filtered data.
  5. The code should then determine the shortest route through the network between the two airports, and print out the airports visited on such a trip.  (Because no distances are supplied with this data, assume that the distances between airports are all the same.)

[ejspence.mycomp] python myRoutes.py
We need two airport codes for arguments!
[ejspence.mycomp] python myRoutes.py YYZ ABC
Sorry, ABC is not in our list of airports.
[ejspence.mycomp] python myRoutes.py YYZ AER
Our route is:
YYZ -> SVO -> AER
[ejspence.mycomp] python myRoutes.py YQC XIY
Our route is:
YQC -> YKG -> YVP -> YUL -> DOH -> CKG -> XIY
[ejspence.mycomp]


Remember to use git to perform version control as you develop your script.  We expect to see many 'git commit' submissions with meaningful comments explaining the creation, progress, testing and debugging of your script.

Submit all files to the 'Assignment Dropbox'.

Assignments will be graded on 10 points basis. Due date is April 10th 2017, with 0.5 penalty point per day off for late submission until the cut-off date of 10am, April 14th, 2017.



Last Modified: Monday Apr 10, 2017 - 10:35. Revision: 18. Release Date: Monday Apr 3, 2017 - 16:00.


Content Navigation


Course Calendar


Course Events



Questions? Contact Support.
Web site engine's code is copyright © ATutor®.
Modifications and code of added modules are copyright of SciNet.