title: find a set of values in a python dictionary based on its name
body: <p>My JSON file has the following structure:</p>
  <pre><code>{ 
    &quot;sets&quot;: 
            [ { &quot;Name&quot;: &quot;set1&quot;,  &quot;Values&quot;: [ &quot;value11&quot;, &quot;value12&quot; ] },
              { &quot;Name&quot;: &quot;set2&quot;,  &quot;Values&quot;: [ &quot;value21&quot;, &quot;value22&quot; ] } 
            ] 
  }
  </code></pre>
  <p>The names are more meaningful than that, and there is more in the JSON. It is read by the <code>json</code> package into a dictionary, and my python script at some point needs the values from either <code>set1</code> or <code>set2</code>.</p>
  <p>There are more than 2 sets in reality, and to find the right set to use, I now use this for-loop:</p>
  <pre><code>for s in protocol_data [ &quot;sets&quot; ]:
      if ( s [ &quot;Name&quot; ] == &quot;set2&quot; ):
         # do stuff with &quot;Values&quot;
  </code></pre>
  <p>So every time another set is needed, the whole array of sets needs to be traversed, which somehow does not feel like it's the way <code>dict</code> was intended. Could there be a cleverer way (maybe with a different container than <code>dict</code>)?</p>