The goal of this assignment is to get acquainted with Python using Jupyter Notebooks.
You may choose to work on this assignment on a hosted environment (e.g. Azure Notebooks or Google Colab) or on your own local installation of Jupyter and Python. You should use Python 3.6 or higher for your work. To use cloud resources, you should be able to login with your NIU credentials to Azure Notebooks or create/login to a free Google account for Colab. If you choose to work locally, Anaconda is the easiest way to install and manage Python. If you work locally, you may launch Jupyter Lab either from the Navigator application or via the command-line as jupyter-lab
.
In this assignment, we will analyze the HURDAT2 dataset for Atlantic hurricane data from 1851 through 2018. This dataset is provided by the National Hurricane Center and is documented here. You will do some analysis of this data to answer some questions about it. I have provided code to organize this data, but you may feel free to improve this rudimentary organization. I have also provided functions that allow you to check your work. Note that you may choose to organize the cells as you wish, but you must properly label each problem’s code and its solution. Use a Markdown cell to add a header denoting your work for a particular problem. Make sure to document what your answer is to the question, and make sure your code actually computes that. As the goal of this assignment is to become acquainted with core Python, please do not use other libraries except for the collections
library.
You may start with the provided Jupyter Notebook, a1.ipynb. Download this notebook (right-click to save the link) and upload it to your Jupyter workspace (either locally or on a hosted environment). Make sure to execute the first two cells in the notebook (Shift+Enter). The second cell will download the data and define a variable records
which consists of a list of tuples each with two entries:
To access the fourth hurricane’s third tracking point, you would access records[3][1][2]
. Remember indexing is zero-based! Thus [3]
accesses the fourth hurricane, [1]
accesses the list of tracking point strings, and [2]
accesses the third tracking point.
In the provided file, I provided examples of how to check your work. For example, for Problem 1, you would call the check1
function with the number of hurricane names. After executing this function, you will see a message that indicates whether your answer is correct.
The assignment is due at 11:59pm on Wednesday, January 29.
You should submit the completed notebook file required for this assignment on Blackboard. The filename of the notebook should be a1.ipynb
.
Write code that computes the number of unique hurricane names in the dataset. Note that UNNAMED
is not a hurricane name.
split
function for strings will be usefulstrip
function will also be useful to trim whitespaceset
to keep track of all the namesWrite code that computes the most frequently used hurricane name. Again, UNNAMED
does not count!
collections.Counter()
is a good structure to help with counting.Write code that computes the year with the most hurricanes.
Write code that computes the hurricane that went furthest south as measured by the smallest latitude. You need to find the name and the year of the hurricane.
N
character to indicate the northern hemisphere. This needs to be removed to do numeric comparisons.float("81.5")
returns a floating-point value of 81.5.Write code that determines the hurricane with the highest sustained windspeed. You need to find the name, year, and wind speed for this hurricane.
float("81.5")
returns a floating-point value of 81.5.