- Create A Function Average From Csv Filename To Calculate The Average Of The Numbers At The Second Column In A Csv Fi 1 (250.57 KiB) Viewed 97 times
Create a function average_from_csv(filename) to calculate the average of the numbers (at the second column) in a .csv fi
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Create a function average_from_csv(filename) to calculate the average of the numbers (at the second column) in a .csv fi
Create a function average_from_csv(filename) to calculate the average of the numbers (at the second column) in a .csv file with the given filename. The format of the .csv file is as follows: The columns in each row (line) are separated by commas, like: Taro, 30 Jiro, 40 Hanako, 50 * Hint: use str.split() method * Note: return the average value in the function, no print is needed.