How can i find the minimum value and key in a scipy dictionary of keys?
<p>I'm trying to find the shortest distance between 2 kd trees and am using the scipy function 'sparse_distance_matrix'. The result is returned in a dictionary of keys matrix of the form <code>{(1,2):4.54}</code>.</p>

<p>Its possible to retrieve the value using the following code but no method seems to work to get the key value since its in tuple form</p>

<pre><code>sparsemin = sp.KDTree.sparse_distance_matrix(aKD,bKD,20)
m = min(sparsemin.itervalues())
</code></pre>