Skip to article frontmatterSkip to article content

Exercise 9 - numpy

5 total points

Directions

  • Due: 11/19/2025 @ 11:59 p.m.

  • Change the name of your notebook to EX9_FirstLast.ipynb, where First is your first name and Last is your last name.

  • For each of the following prompts, write or modify Python code that fulfills the requirements.

You must use numpy for all calculations.

Task 1 (2 points)

Convert the following python lists into numpy.ndarrays.

dkb_high_temps are average high temps for each month in DeKalb in Fahrenheit

dkb_low_temps are average low temps for each month in DeKalb in Fahrenheit

dkb_precip are average precipitation totals for each month in DeKalb in inches

dkb_high_temps = [28, 32, 45, 59, 70, 80, 83, 81, 75, 62, 46, 34]

dkb_low_temps = [13, 17, 27, 37, 49, 60, 63, 61, 53, 41, 30, 19]

dkb_precip = [1.69, 1.71, 2.24, 3.56, 4.79, 4.57, 4.00, 4.06, 3.32, 2.96, 2.31, 2.04]

# replace None with your code
dkb_high_npy = None

# replace None with your code
dkb_low_npy = None

# replace None with your code
dkb_precip_npy = None

Task 2 (1 point)

Convert dkb_precip_npy, which are monthly totals of rainfall in inches to millimeters.

# replace None with your code
dkb_precip_mm = None

Task 3 (1 point)

Find the average daily temperature for each month using dkb_high_npy and dkb_low_npy.

# replace None with your code
dkb_average = None

Task 4 (1 point)

Find the difference between high and low temperatures for each month using dkb_high_npy and dkb_low_npy.

# replace None with your code
dkb_difference = None