I have a dictionary which looks like this:
bigdict = {
'a': {'foo':2, 'bar':3, 'baz':7, 'qux':1},
'b': {'foo':6, 'bar':4, 'baz':3, 'qux':0},
'c': {'foo':4, 'bar':5, 'baz':1, 'qux':6}
}
And for each dictionary, I want to be able to grab the 2 keys with the highest values and put the results in a new dictionary.
e.g.
newbigdict = {
a: {'baz':7, 'bar':3},
b: {'foo': 6, 'bar':4},
c: {'qux':6, 'bar':5}
}
Any ideas? I've been stuck on this for a while. I use Python 3.