A
alain
I have a problem I wonder if it has been solved before.
I have a dictionnary and I want the values in the dictionnary to be
annotated with the rank that would be obtained by sorting the values
def annotate_with_rank(my_dict):
....
return my_annotated_dict
In other words, any value a_value would become a 2-tuple
(a_value,rank_of_a_value)
I seek an elegant solution.
Alain
I have a dictionnary and I want the values in the dictionnary to be
annotated with the rank that would be obtained by sorting the values
def annotate_with_rank(my_dict):
....
return my_annotated_dict
In other words, any value a_value would become a 2-tuple
(a_value,rank_of_a_value)
I seek an elegant solution.
Alain