I have a list of dictionaries. Let's say
total = [{"date": "2014-03-01", "value": 200}, {"date": "2014-03-02", "value": 100}{"date": "2014-03-03", "value": 400}]
I need to get the maximum, minimum, average value from it. I can get the max and min values ββusing the code below:
print min(d['value'] for d in total) print max(d['value'] for d in total)
But now I need to get the average value from him. How to do it?
source share