Microsoft Word - Small Project 1.docxSmall Project 1 Due: April 3rd, 10:15 AM 15 pts You have been hired as a consultant for a travel company who specializes in trips for Chicagoans to...

A small python project organizing data


Microsoft Word - Small Project 1.docx Small Project 1 Due: April 3rd, 10:15 AM 15 pts You have been hired as a consultant for a travel company who specializes in trips for Chicagoans to visit Seattle, Washington. Seattle is known for being rainy and overcast, but is that really the case? Included with this assignment is a csv file called Seattle2014.csv. It includes historical daily weather data for Seattle. Each row corresponds with an individual day; dates are written in the format YYYYMMDD. We’re going to focus on 3 different weather data measurements: • PRCP or precipitation (mm) • TMAX or maximum recorded temperature (F) • TMIN or minimum recorded temperature (F) The travel company has asked for you to provide the following information so that they can inform their clients on when it’s best to visit Seattle. 1. How many days out of the year does it actually rain? 2. What is the average and standard deviation of precipitation (in inches) when it does rain? 3. How many days does it rain per month? 4. How many total inches does it rain per month? 5. What is the minimum and maximum recorded temperature per month? 6. Is it hot rain or chilly rain? What is the average minimum and maximum recorded temperatures on days that it rains? How does that compare to days that it doesn’t rain? Logistics: (1) You can only use csv and numpy (i.e. import csv and import numpy) in addition to built-in Python functions. (2) When there’s an option to use a numpy ufunc over a built-in Python function, you need to select the numpy ufunc. Imagine that they have data from the last 50 years and are interested in having you perform these calculations and more on this larger data set. (3) Your output must be formatted to resemble the format shown below and written to file called Seattle_Data.csv; this is what your client wants. Note, you cannot make any changes to the Seattle2014.csv file; your code must read the one provided. Output Format: Note, I’ve made up answers, shown in blue. This is where your answers will go. Annual Statistics: # of days it rains: 365 Avg (stdev) rainfall: 9.3 +/- 2.4 inches Avg min & max temperature on rainy days: 3.5 F - 100.2 F Avg min & max temperature on non-rainy days: 5.3 F - 90 F Monthly Statistics: Month # days it rains # inches of rain Min temp (F) Max temp (F) January 40 9 2 100 February 40 9 2 100 March 40 9 2 100 April 40 9 2 100 … (The file will be a csv file so columns within a row should be separated by a comma.) Grading Rubric: Your submission must include your code and your output file. 9 pts total. Correct answers for the following questions using numpy arrays and functionality: 1. (1 pt) How many days out of the year does it actually rain? 2. (2 pts total) What is the average and standard deviation of precipitation (in inches) when it does rain? (0.5 pts for average; 0.5 pts for standard deviation; 0.5 pts only considers rainy days; 0.5 pts conversion to inches) 3. (1 pt) How many days does it rain per month? 4. (1 pt) How many total inches does it rain per month? 5. (2 pts total) What is the minimum and maximum recorded temperature per month? (1 pt minimum and 1 pt maximum) 6. (2 pts total) Is it hot rain or chilly rain? What is the average minimum and maximum recorded temperatures on days that it rains? How does that compare to days that it doesn’t rain? (1 pt min/max rainy days; 1 pt min/max non-rainy days) Note, if you do not use numpy to perform these calculations, you will receive no credit. 1 pt. Properly reads in input file using csv. 2 pts total. Writes results to file (0.5 pts) and follows the specified output format (1.5 pts). 2 pts. Comments in code. 1 pt. Efficiency of computations. Numpy includes several functions to efficiently perform calculations, e.g. broadcasting, searching, and sorting.
Mar 29, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here