python ranking a list of values, using average rank for non-unique values
<p>Is there a more pythonic, faster want to rank a dictionary by values and average the rank for the non unique values. My approach:</p>

<pre><code>d = {'a':5,'b':5,'c':5,'d':1,'e':6}
ordered_keys = sorted(d, key=d.get)
ordered_v = [d[k] for k in ordered_keys]
value_rank = [(ordered_v.index(v)+1)+(ordered_v.count(v)-1)/2 for v in ordered_v]
ranked_key_list = zip(ordered_keys,value_rank)
[('d', 1), ('a', 3), ('c', 3), ('b', 3), ('e', 5)]
</code></pre>

<p>This broad discussion on sorting dictionaries was very helpful: <a href="http://stackoverflow.com/questions/6046049/python-dictionary-values-sorting">python dictionary values sorting</a></p>
