title: Python build one dictionary from a list of keys, and a list of lists of values
body: <p>So I have a list of keys:</p>
  
  <pre><code>keys = ['id','name', 'date', 'size', 'actions']
  </code></pre>
  
  <p>and I also have a list of lists of vales:</p>
  
  <pre><code>values=
      [
          ['1','John','23-04-2015','0','action1'],
          ['2','Jane','23-04-2015','1','action2']
      ]
  </code></pre>
  
  <p>How can I build a dictionary with those keys matched to the values?</p>
  
  <p>The output should be:</p>
  
  <pre><code>{
      'id':['1','2'],
      'name':['John','Jane'],
      'date':['23-04-2015','23-04-2015'],
      'size':['0','1'],
      'actions':['action1','action2']
  }
  </code></pre>
  
  <p>EDIT:
  I tried to use zip() and dict(), but that would only work if the list of values had 1 list, i.e. <code>values = [['1','John','23-04-2015','0','action1']]</code></p>
  
  <pre><code>for list in values:
      dic = dict(zip(keys,list))
  </code></pre>
  
  <p>I also thought about initialising a dic with the keys, then building the list of values on my own, but I felt that there had to be an easier way to do it.</p>
  
  <pre><code>dic = dict.fromkeys(keys)
  
  for list in values:
      ids = list[0]
      names = list[1]
      dates = list[2]
      sizes = list[3]
      actions = list[4]
  </code></pre>
  
  <p>and then finally </p>
  
  <pre><code>dic['id'] = ids
  dic['name'] = names
  dic['date'] = dates
  dic['size'] = sizes
  dic['action'] = actions
  </code></pre>
  
  <p>This seemed really silly and I was wondering what a better way of doing it would be.</p>