I have a nested dictionary of type following
{id_1 : [ {id_2:score},{id_3:score_2} .... and so on],id_2 :[{id_1:Score_!....]}
so basically a nested dictionary Now I want to sort this dictionary per primary id on the basis of score so basically
{id_1: [{element with max_score},{element_with next max_score....}]... id_2:[{element_with max_score},{element_with next maxx score}...]
also, the function should take an argument say (n) which returns the top n matches or if the n< number of elements of that id then it returns teh complete list any Ideas/ thoughts.. Thanks