title: Python extract max value from nested dictionary
body: <p>I have a nested dictionary of the form:</p>
  
  <pre><code> {'2015-01-01': {'time': '8', 'capacity': '5'}, 
    '2015-01-02': {'time': '8', 'capacity': '7'},
    '2015-01-03': {'time': '8', 'capacity': '8'} etc}
  </code></pre>
  
  <p>The dictionary is created from a csv file using dictreader. What I would like to be able to do is return the maximum value of capacity. So in this case 8.</p>
  
  <p>I can use:</p>
  
  <pre><code>for k,v in input_dict.items():
      if temp_max &lt; int(v['capacity']):
          temp_max = int(v['capacity'])
  </code></pre>
  
  <p>which works but I wondered if there was a neater method? I've searched and found methods to extract the top level key associated with the maximum value which is of course not what I need. See below:</p>
  
  <pre><code>max(input_dict, key=lambda v: input_dict[v]['capacity'])
  </code></pre>
  
  <p>which would return '2015-01-03', So I imagine there is a simple mod to the above one liner that will give me what I need but is has me stumped!</p>
  
  <p>Any ideas?</p>