Question: Someone to help me with this python problem. Step 2 - Creating a module for Input/Output and the main function In this step, you will
Someone to help me with this python problem.




Step 2 - Creating a module for Input/Output and the main function In this step, you will create another module with name InputOutputHandler. To create the module, you can open a new python script. Save the script with the gven name InputOutputHandler.py. This module contains the following functions: printCSVResults(columnsDictionary): This function will display a table of results (see sample output below). This functions has a single parameter columnsDictionary 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 = {} dl'Bob'1 = "2044748845"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 = {} d [' Bob' ] = "2044748845" d [' Amy '] = "2048749484" d [' Albert '] = "2044349423" d [' James' ] = "2042685555" for i in sorted (d. keys() ) : # get keys in ascending order print (i, end = " ") 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 cav file. This function will return the header and data. It is important that the function be able to read any number of columns from the cav 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 FirstnameLastnameA1Q1.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 includingThis 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 csy file. This function will return the header and data. It is important that the function be able to read any number of columns from the cav 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 FirstnameLastnameA1Q1.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 . cav and Bodyfat . cav from assignment 1. Data source: http://climate.weather.gc.ca/climate_data/daily_data_e.html?StationID= Sample output: Enter file name: reducedweather . csv Column Names | Mean | Std Deviation | Highest Score | Lowest Scor Max Temp | 10.101 16.91 1 36.601 -29 3Step 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 StatisticsCalculation.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. calculateMean(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. findMin(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 Output Handler. To create the module, you can open a new python script. Save the script with the gven name InputOutputHandler.py. This module contains the following functions: printCSVResults(columnsDictionary): This function will display a table of results (see sample output below). This
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
