Outcomes Loops and Conditions Dictionaries Functions Question 1: Required For this question, you will revised what was asked of you in assignment 1. You will reimplement your solution using nested dictionaries instead to store the results of your statistics calculations you will decompose your program using functions. Your program should not need to make use of concepts and constructs beyond functions as covered in class. As in assignment 1, you will develop a program to calculate some statistics for a csv file. As an example, the csv file reducedweather.csv contains tabular data which includes Manitoba daily minimum and maximum temperatures (2 columns) from Jan until Sept 17 in 2019. The first row is a header record (row), with headings Max Temp and Min Temp. This is known as the header record. After the header row, each row is a day where maximum and minimum temperature for that day is recorded. From this file, you need to calculate mean, standard deviation, highest and lowest temperature for each column. You may assume that each csv file that your program reads will have a header record with a fixed number of columns, say c columns, and the remaining rows each consists of e columns of numerical data values (also known as observations). The description for this problem is the same as the assignment 1 question 1. But in this assignment you need to create functions for reading the file, finding standard deviation, squared difference, max and mean value, and printing the results. Step 1 - Creating a module of functions for computing statistics As a first step, create a module with name StatisticsCalculation. To create the module, you can open a new python script. Save the script with the given name Statistics Calculation.py. The statistics calculation module contains following functions. Your functions should do the computations directly without relying on any Python functions such as min,max, sum etc. calculate Mean(data): The parameter data is a list of floating point values. This function will calculate and return the mean. Remember, data is a single list, it does not contain any nested list. calculateStdDev(data): Given a list of data values, calculate and return the standard deviation. Again remember, data is a single list, it does not contain any nested list. find Min(data): Given a list of data, this function will return the min. The parameter data is a single list, it does not contain any nested list. You can not use any built in function to calculate the minimum value. In this function, you need to implement your own function to find the minimum element in data. findMax(data): Given a list of data, this function will return the max. The parameter data is a single list, it does not contain any nested list. You can not use any built in function to calculate the maximum value. In this function, you need to implement your own function to find the maximum element in data. Step 2 - Creating a module for Input/Output and the main function In this step, you will create another module with name Input OutputHandler. "To create the module, you can open a new python script. Save the script with the gven name Input OutputHandler.py. This module contains the following functions: printCSVResults(columns Dictionary): This function will display a table of results (see sample output below). This functions has a single parameter columns Dictionary which is a nested dictionary keyed by the column name. For each column name, the value stored in the dictionary is another dictionary holding the values for the minimum, maximum and standard deviation for that column. To get the keys ordered in a consistent manner for printing, you may want to use the sorted. Sample code is given below on usage. d = 0) d['Bob'] = "2044748845 d'Any'] = "2048749484" d'Albert'] = "2044349423" d[ James') - "2042685555" for i in sorted (d.keys()) : print(1, end -"") get keys in ascending order readCSVFile(fileName): This function will read in the CSV file. The parameter fileName is a string. Open the file and read the header row and data from the csv file. This fi will return the header and data. It is important that the function be able to read any number of columns from the esv file. main(): Create a main function and from the main function call these appropriate functions to read in a CSV file (as inputted by the user), compute the required statistics for each column, and display the results. In your main function, you should use a nested dictionary for storing the mini- mums, maximums, standard deviations of each column that you have computed (instead of a bunch of lists used in Assignment 1). Your main dictionary should be keyed by the column name and the value stored in the dictionary for that key is another dictionary that contains the minimum, maximum, and standard deviation for that column. Step 3-Creating the FirstnameListname A101.py File In this file, import the StatisticsCalculation module and call the main function. This is the program that should be executed by Python (with will in turn make use of the other modules). Testing You should test your program on various CSV files including reducedweather.csv and Bodyfat.csv from assignment 1. Data source: http://climate.weather.gc.ca/climate data/daily data e.html?StationID=27174 Sample output: Enter file name: reducedweather.csv Column Names Mean I Std Deviation | Highest Score 1 Lowest Score Max Temp! 10.101 16.911 36.601 -29.80 Min Temp! -2.201 12.01 1. 15.171 2 21.301 .2012 -39.90 Programmed by the Instructors Date: Tue Feb 4 11:48:07 2020 End of processing What to hand in Hand in the three python files StatisticsCalculation.py, InputOutputHandler.py and FirstnameLastnameA1Q1.py. Outcomes Loops and Conditions Dictionaries Functions Question 1: Required For this question, you will revised what was asked of you in assignment 1. You will reimplement your solution using nested dictionaries instead to store the results of your statistics calculations you will decompose your program using functions. Your program should not need to make use of concepts and constructs beyond functions as covered in class. As in assignment 1, you will develop a program to calculate some statistics for a csv file. As an example, the csv file reducedweather.csv contains tabular data which includes Manitoba daily minimum and maximum temperatures (2 columns) from Jan until Sept 17 in 2019. The first row is a header record (row), with headings Max Temp and Min Temp. This is known as the header record. After the header row, each row is a day where maximum and minimum temperature for that day is recorded. From this file, you need to calculate mean, standard deviation, highest and lowest temperature for each column. You may assume that each csv file that your program reads will have a header record with a fixed number of columns, say c columns, and the remaining rows each consists of e columns of numerical data values (also known as observations). The description for this problem is the same as the assignment 1 question 1. But in this assignment you need to create functions for reading the file, finding standard deviation, squared difference, max and mean value, and printing the results. Step 1 - Creating a module of functions for computing statistics As a first step, create a module with name StatisticsCalculation. To create the module, you can open a new python script. Save the script with the given name Statistics Calculation.py. The statistics calculation module contains following functions. Your functions should do the computations directly without relying on any Python functions such as min,max, sum etc. calculate Mean(data): The parameter data is a list of floating point values. This function will calculate and return the mean. Remember, data is a single list, it does not contain any nested list. calculateStdDev(data): Given a list of data values, calculate and return the standard deviation. Again remember, data is a single list, it does not contain any nested list. find Min(data): Given a list of data, this function will return the min. The parameter data is a single list, it does not contain any nested list. You can not use any built in function to calculate the minimum value. In this function, you need to implement your own function to find the minimum element in data. findMax(data): Given a list of data, this function will return the max. The parameter data is a single list, it does not contain any nested list. You can not use any built in function to calculate the maximum value. In this function, you need to implement your own function to find the maximum element in data. Step 2 - Creating a module for Input/Output and the main function In this step, you will create another module with name Input OutputHandler. "To create the module, you can open a new python script. Save the script with the gven name Input OutputHandler.py. This module contains the following functions: printCSVResults(columns Dictionary): This function will display a table of results (see sample output below). This functions has a single parameter columns Dictionary which is a nested dictionary keyed by the column name. For each column name, the value stored in the dictionary is another dictionary holding the values for the minimum, maximum and standard deviation for that column. To get the keys ordered in a consistent manner for printing, you may want to use the sorted. Sample code is given below on usage. d = 0) d['Bob'] = "2044748845 d'Any'] = "2048749484" d'Albert'] = "2044349423" d[ James') - "2042685555" for i in sorted (d.keys()) : print(1, end -"") get keys in ascending order readCSVFile(fileName): This function will read in the CSV file. The parameter fileName is a string. Open the file and read the header row and data from the csv file. This fi will return the header and data. It is important that the function be able to read any number of columns from the esv file. main(): Create a main function and from the main function call these appropriate functions to read in a CSV file (as inputted by the user), compute the required statistics for each column, and display the results. In your main function, you should use a nested dictionary for storing the mini- mums, maximums, standard deviations of each column that you have computed (instead of a bunch of lists used in Assignment 1). Your main dictionary should be keyed by the column name and the value stored in the dictionary for that key is another dictionary that contains the minimum, maximum, and standard deviation for that column. Step 3-Creating the FirstnameListname A101.py File In this file, import the StatisticsCalculation module and call the main function. This is the program that should be executed by Python (with will in turn make use of the other modules). Testing You should test your program on various CSV files including reducedweather.csv and Bodyfat.csv from assignment 1. Data source: http://climate.weather.gc.ca/climate data/daily data e.html?StationID=27174 Sample output: Enter file name: reducedweather.csv Column Names Mean I Std Deviation | Highest Score 1 Lowest Score Max Temp! 10.101 16.911 36.601 -29.80 Min Temp! -2.201 12.01 1. 15.171 2 21.301 .2012 -39.90 Programmed by the Instructors Date: Tue Feb 4 11:48:07 2020 End of processing What to hand in Hand in the three python files StatisticsCalculation.py, InputOutputHandler.py and FirstnameLastnameA1Q1.py