title: Filter a dict of dict
body: <p>I new in Python and I am not sure it is a good idea to use dict of dict but here is my question.
  I have a dict of dict and I want to filter by the key of the inside dict:</p>
  
  <pre><code>a ={ 'key1' : {'id1' :[0,1,2] , 'id2' :[0,1,2], 'id3' :[4,5,6]}
       'key2' : {'id3' :[0,1,2] , 'id4' :[0,1,2]}
       'key3' : {'id3' :[0,1,2] , 'id1' :[4,5,6]}
     }
  </code></pre>
  
  <p>For exemple , I want to filter by 'id1' to have :</p>
  
  <pre><code>result = { 'key1' : {'id1' :[0,1,2] }
             'key3' : {'id1' :[4,5,6]}
           }
  </code></pre>
  
  <p>I have tried the filter method by I get all the value:</p>
  
  <pre><code>r = [('key1' ,{'id1' :[0,1,2] , 'id2' :[0,1,2], 'id3' :[4,5,6]})
       ('key3' , {'id3' :[0,1,2] , 'id1' :[4,5,6]})
     ]
  </code></pre>
  
  <p>Furthermore the filter method returns a list and I want to keep the format as a dict.</p>
  
  <p>Thanks in advance</p>