Question: 4 . In python. Modify your in - class fileRW.py assignment to be a function called IO . The function will have
In python. Modify your inclass "fileRW.py assignment to be a function called IO The function will have two input values for the input and output files. If the input file does not exist it should give a descriptive message about the input file. IO should also do the following:
a The file should automatically determine the number of heading lines in the input file, the number of data columns, and the number of data rows. Assume the header information is finished if the string in the first column is a floatingpoint value. Store the heading information and write it back to the output file. Add one line to the header data explaining the number of data points in the moving average obtained in the next step
b After the number of columns and data rows have been determined, your function should print out the number of rows and columns and the average and standard deviation of each column with the name of the data file. The user should then be asked with input command for the number of data points for a moving average together. The input text should be clear and descriptive. It should keep asking the user for input until a valid integer is obtained. If an appropriate response is not entered it should print a statement about what is wrong with the input and then ask again for new input.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
