title: How to switch the nesting structure of a dictionary of dictionaries in Python
body: <p>If I have the following dictionary:</p>
  
  <pre><code>dict_a = {'a': {'x': 0, 'y': 1, 'z': 2},
            'b': {'x': 3, 'y': 4, 'z': 5}}
  </code></pre>
  
  <p>What is the best way to switch the structure of the dictionary to:</p>
  
  <pre><code>dict_b = {'x': {'a': 0, 'b': 3},
            'y': {'a': 1, 'b': 4},
            'z': {'a': 2, 'b': 5}}
  </code></pre>