I have a data file with the following format:
name,cost1,cost1,cost1,cost2,cost3,cost3,
X,2,4,6,5,6,8,
Y,0,3,6,5,4,6,
.
.
....
Now, what I would like to do is to convert this to a dictionary of dictionaries such that
{'X', {'cost1': 4, 'cost2':5, 'cost3':7}},{'Y', {'cost1': 3, 'cost2':5, 'cost3':5}}....
where the values of each key is the average from the data file. How could this be done?