I know how to find the key corresponding to the maximum value in a dictionary, thanks to the answers to the following quesyions on Stackoverflow -
Print the key of the max value in a dictionary the pythonic way,
key corresponding to maximum value in python dictionary,
Getting key with maximum value in dictionary?, etc.
But I am not being able to understand how these will work out for a dictionary of dictionary.
Example-
I have a dictionary of dictionary d[x][l]. Suppose, I need to find the following-
For a particular l='green', I need to find the corresponding value of x for which d[x]['green'] is maximum.
How to use the max() function in this case? I want to avoid looping over. I was hoping to find something equivalent to the MATLAB way of doing it in a matrix- max(d(:,l)).
d[x][l] takes integer values, and so does x.