Question: Write a fnctional programme in python: Write a function 'mean_rms_file0' which receives as single input argument a file name as a string. The function shall
Write a fnctional programme in python:
Write a function 'mean_rms_file0' which receives as single input argument a file name as a string. The function shall open the file and read the single-column data and calculate the mean value of the numbers in the file as well as the RMS (root mean square) value, see below. You can test your function with Spyder using the supplied 'data1.txt file from the python folder on the moodle website (Result: mean -20.95, RMS 21.1569..) Return the mean value and the RMS value as a tuple in that order. Note that the RMS value is defined as where 2 is the variance of the data, a,mean the mean value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
