Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions 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

Instructions

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 problems 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:

  1. a string with information about the hurricane and
  2. a list of strings each of which is a tracking point for the hurricane

To access the fourth hurricanes 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.

Due Date

The assignment is due at 11:59pm on Wednesday, January 29.

Submission

You should submit the completed notebook file required for this assignment on Blackboard. The filename of the notebook should be a1.ipynb.

Details

1. Number of Unique Hurricane Names (10 pts)

Write code that computes the number of unique hurricane names in the dataset. Note that UNNAMED is not a hurricane name.

Hints:

  • You will need to extract the name from the string in the first entry in the tuple
  • The split function for strings will be useful
  • The strip function will also be useful to trim whitespace
  • Consider using a set to keep track of all the names

2. Most Frequently Used Name (10 pts)

Write code that computes the most frequently used hurricane name. Again, UNNAMED does not count!

Hints:

  • collections.Counter() is a good structure to help with counting.
  • Clean up the strings in the same manner as in Problem 1.

3. Year with Most Hurricanes (10 pts)

Write code that computes the year with the most hurricanes.

Hints:

  • You can extract the year from the first entry in the tuple. It is the last four characters before the first comma.

4. Most Southerly Hurricane (10 pts)

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.

Hints:

  • Check the documentation to find where the latitude is recorded.
  • You will need to go through the tracking points to check all of the latitude points recorded.
  • You need to keep track of three things: the minimum latitude seen so far plus the name of the corresponding hurricane and year
  • The latitude adds the N character to indicate the northern hemisphere. This needs to be removed to do numeric comparisons.
  • You can convert a string to a float or int by casting it. For example, float("81.5") returns a floating-point value of 81.5.

5. Hurricane with Maximum Sustained Wind (10 pts)

Write code that determines the hurricane with the highest sustained windspeed. You need to find the name, year, and wind speed for this hurricane.

Hints:

  • Check the documentation to find where the wind speed is recorded.
  • You will need to go through the tracking points to check all of the wind speeds recorded.
  • You can convert a string to a float or int by casting it. For example, float("81.5") returns a floating-point value of 81.5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions