A study was conducted to answer the following question:
Do people save more when they are more educated or when they get older?
Participants were asked to provide their age group, education level, and current savings. All answers are stored in a CSV file named savings.csv
:
age_group,education,savings
26-30,primary,6965
31-35,primary,5520
36-40,secondary,24606
41+,tertiary,82387
...
Your task is to calculate the average savings for each study group. A study group is a combination of an education level and age group. The end result should be stored in a CSV file named savings_report.csv
and should look like this (random average values are provided as examples):
primary (26-30),3450.34
primary (31-35),1230.0
primary (36-40),2519.2
primary (41+),3746.81
...
secondary (31-35),13102.46
secondary (36-40),15670.73
...
You don't need to sort the records in the output file in any specific order.