I have a dict of dict object. What is the best way to find keys associating with the min value of the object? For example:
myDict = {'a': {'n': 1, 'm' : 2, 'l' : 3}, 'b':{'m' = 2, 'l': 3, 'k':4}}
(firstKey, secondKey) = argmin(myDict)
The argmin should return 'a' and 'n' What I am doing now is:
minValue = 10
firstKey, secondKey = None, None
for k1 in myDict.keys():
for k2 in myDict[k1].keys():
if myDict[k1][k2] < minValue:
minValue = myDict[k1][k2]
firstKey, secondKey = k1, k2