I am facing an issue with getting the maximum of each key in an list of dictionary. for example I have a list of dictionaries ls:
ls = [{'a':2, 'b':4, 'c':7}, {'a':5, 'b': 2, 'c':6}, {'a':1, 'b': 3, 'c':8}]
The output should be {a = 5, b = 4, c = 8}
I have tried a number of methods, for example:
maxx= max(ls, key=lambda x:x['a'])
but this and every other method is returning me the sub-dictonary having the maximum "a" value, b and c is not getting considered
can anyone please help me out on this