I have created a dictionary
in python. I have sorted the dictionary with the following instruction.
dict = {}
dict[identifier] = dst
sorted_dict = sorted(dict.items(), key=operator.itemgetter(1))
print sorted_dict
Here identifier
is key
and dst
is a value
I want to retrieve first N
elements from the dictionary. How I can do that?