title: Choose smallest value in dictionary
body: <p>I have a dictionary given in the form <code>{(i1,r1,m1):w, (i2,r2,m1):w, (i1,r1,m2):w ...}</code> where i is the activity, r the type of resource, m the mode, and w is the resources of type r needed of activity i in mode m.</p>
  <p>Now I would like to choose for every activity  the mode, that requires the least resources (w). If possible, at the end in a list in the form [(i,m),...] for every i.</p>
  <p>My tutor suggested to work with <code>np.argmin()</code>, but for this I have to convert the dictionary into an array. So I tried to convert the dictionary into an array:</p>
  <pre><code>w_list = list(w.items())
  w_array = np.array(w_list)
  
  print(w_array)
  
  array([[(0, 1, 1), 0],
         [(0, 2, 1), 0],
         [(1, 1, 1), 9],
         [(1, 2, 1), 0], ...
  </code></pre>
  <p>However, this array arrangement cannot be used for <code>np.argmin</code>.</p>
  <p>Does anyone have any other idea how I can get the desired list mentioned above?</p>