Now You Code 4: Syracuse Weather

Write a program to load the Syracuse weather data from Dec 2015 in JSON format into a Python list of dictionary.

The file with the weather data is: "NYC4-syr-weather-dec-2015.json"

You should load this data into a Python list of dictionary using the json package.

After you load this data, loop over the list of weather items and record whether or not the 'Mean TemperatureF' is above or below freezing.

Sort this information into a separate Python dictionary, called stats so you can print it out like this:

{'days-below-freezing': 4, 'days-above-freezing': 27}

After you print the information write it to the file NYC4-syr-weather-dec-2015-stats.json

Step 1: Problem Analysis

This function should get input from the user at run time and return the input address.

Inputs:

Outputs:

Algorithm (Steps in Program):


In [ ]:
# Step 2: Write code

Step 3: Questions

  1. What are the advantages to storing the number of days above freezing and below freezing in a Python dictionary?

Answer:

  1. What is the data type of the weather data as it is read from the file NYC4-syr-weather-dec-2015.json ?

Answer:

  1. Could this same program work for weather at other times in other cities? What conditions would need to be met for this to happen?

Answer:

Step 4: Reflection

Reflect upon your experience completing this assignment. This should be a personal narrative, in your own voice, and cite specifics relevant to the activity as to help the grader understand how you arrived at the code you submitted. Things to consider touching upon: Elaborate on the process itself. Did your original problem analysis work as designed? How many iterations did you go through before you arrived at the solution? Where did you struggle along the way and how did you overcome it? What did you learn from completing the assignment? What do you need to work on to get better? What was most valuable and least valuable about this exercise? Do you have any suggestions for improvements?

To make a good reflection, you should journal your thoughts, questions and comments while you complete the exercise.

Keep your response to between 100 and 250 words.

--== Write Your Reflection Below Here ==--