Skip to content

The prompt for the Python assignment of the UCACCMET2J course.

Notifications You must be signed in to change notification settings

teunvg/ucaccmet2j_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

UCACCMET2J Python assignment

This file contains some information about the dataset you will be working with for this assignment. The data itself is included with this repository. Please make sure that you have first forked the repository to your own GitHub account before cloning it to your computer and starting to work on it.

Does it always rain in Seattle?

The data

You are provided with two datasets: one set contains weather stations associated with their locations, in the form of a CSV file. This file is called stations.csv and contains 4 entries. The other set contains rain in tenths of millimeters per day per weather station in 2010. This file is called precipitation.json and contains approximately 1450 entries. Take a look at the two files and their structure.

The big data

Load the JSON data and loop through it. We want you to calculate the monthly mm of rain for Seattle, as well as the total mm of rain over the whole year.

Relatively rainy

Next, we want you to calculate the percentage of the yearly rain per month; i.e., if 20% of the rain in 2010 in Seattle fell in November, the corresponding value should read 0.2.

Results

Save these results in a single JSON file called result.json. Save your data in a dictionary, where location name is the key, and the value is another dictionary, containing the corresponding state, weather station, precipitation per month, relative precipitation per month, total precipitation.

An partial example of correct output (with values left out) for Cincinnati would be:

{
	"Cincinnati": {
		"station": "GHCND:USW00093814", 
		"state": "OH", 
		"totalMonthlyPrecipitation": [...], 
		"relativeMonthlyPrecipitation": [...], 
		"totalYearlyPrecipitation": ...,
		"relativeYearlyPrecipitation": ...
	},
	...
}

About

The prompt for the Python assignment of the UCACCMET2J course.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published