title: How to create a list of dictionaries from a dictionary with lists of different lengths
body: <p>I want to create a list of dictionaries with the same index element from each list. </p>
  
  <p>I have this dictionary:</p>
  
  <pre><code>d = {'name': ['bob', 'john', 'harry', 'mary'], 
       'age': [13, 19, 23], 
       'height': [164, 188], 
       'job': ['programmer']}
  </code></pre>
  
  <p>The desired output is:</p>
  
  <pre><code>d2 = [{'name': 'bob', 'age': 13, 'height': 164, 'job': 'programmer'}, 
        {'name': 'john', 'age': 19, 'height': 188}, 
        {'name': 'harry', 'age': 23},
        {'name': 'mary'}]
  </code></pre>
  
  <p>I have tried something like this:</p>
  
  <pre><code>d2 = [dict(zip(d, t)) for t in zip(*d.values())]
  </code></pre>
  
  <p>But my output is:</p>
  
  <pre><code>d2 = [{'name': 'bob', 'age': 13, 'height': 164, 'job': 'programmer'}]
  </code></pre>
  
  <p>I think this is happening because the lists have different lengths.</p>