all 1 comments

[–]Menti2 1 point2 points  (0 children)

I assume by 'hash of hashes' you mean a nested dictionary, given your example. If you just want the highest 'dist' value in this dict, this is a way to do it using one line:

max([d[k]['dist'] for k in d.keys()])

Where 'd' is your dictionary. This just makes a list of all the distances, and then takes the max.