Question: Write the function calculate _ column _ average that takes 2 arguments: csv _ file: which is the name of the csv _ file that

Write the function calculate_column_average that takes 2 arguments:
csv_file: which is the name of the csv_file that is to be read
column_no: which is the number of the data column that we want to calculate the average for.
For example, if we have the following values in a csv file:
2,6,3
2,6,3
The average for column 0 is 2
The average for column 1 is 6
The average for column 2 is 3
Instructions:
Remember, in CSV files, the values in columns are separated by commas.
You only need to calculate the average for a specific column
Moodle will test the function, you only need to write it
You are free to use python functions or loops to calculate the average
Answer: (penalty regime: 0%)
Write the function calculate _ column _ average

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 Programming Questions!