Question: Part I Data Processing keyboard_arrow_down For the first section of this project, you will use the csv library to read Atmosphere Temperature, Soil Temperature, Atmosphere

Part I Data Processing

keyboard_arrow_down

For the first section of this project, you will use the csv library to read Atmosphere Temperature, Soil Temperature, Atmosphere Humidity and Soil Humidity from Plant_Data.csv. Don't forget to close your file at the end!

  1. Create a function to read each variable into a dictionary using the csv.DictReader() function
  2. Inside of that same function, use a for loop to append each of the value pairs for each category to an empty list
  3. Pass these lists to another function that will calculate the averages if the values in each list (Hint: Make sure your data is the correct data type)
  4. Use the function to return these averages to the main(). Display the 4 average values inside main() with 2 digit precision.
Part I Data Processing keyboard_arrow_down ForPart I Data Processing keyboard_arrow_down For
[3] import csv from statistics import mean def read_to_list(): #### Fix Me #### with open( ' ''PATH TO DATA" " ' ) as cavfile: #create dictionary with key value pairs foratm tep, atm hum, soil hum and soil temp reader = csv. DictReader (csvfile) #create empty lists for values for each month (7 key value pairs) atm_temp_avg = soil_temp_avg = atm_hum_avg = soil_hum_avg = #append each value pair of dictionary to list for i in reader: #### Fix Me #### #### Fix Me #### def calc_avgs(????): #convert hum and temp values to floats average_atm_temp = 0 average_soil_temp = 0 average_atm_hum = 0 average_soil_hum = 0 #convert hum and temp values to floats #average_atm_temp = mean(map(float, atm_temp_avg)) for j in a t: average_atm_temp ??? average_atm_temp /= len(a_t) #### Fix Me #### for . . .??? #### Fix Me #### for. . .???### Fix Me # # # # return ???? # Main function def main( ) : # # # # Fix Me ???? = read_to_list() ???? = calc_avgs (????) #show total averages Fix Me #### print (????) print (????) print (????) print (????) #call main to kick it off Hu## Fix Me

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!