title: Python - Turning a list of dictionaries into a dictionary with lists
body: <p>So I'm having difficulty with aggregating data within Python.
  I wrote a program that extracts data from an Oracle DB and converts it into a list with dictionaries. Each dictionary contains the DB column names as keys</p>
  
  <p>Looking something like this:</p>
  
  <pre><code>[{ColumnName1 : Value, Columnname2 : Value}, 
  {ColumnName1 : Value, Columnname2 : Value}]
  </code></pre>
  
  <p>The problem I'm having is the redundant columnnames. From this list of dictionaries I would like to create a dictionary containing each column name as a key only once. After that adding a list of the values that belong to that columnname.</p>
  
  <p>Any Ideas?</p>
  
  <p>I'm using Cx_Oracle to extract the data from the DB.
  I'm using the following code to create the list of dictionaries. 
  The reason I'm doing this is because Oracle_CX doesn't return column names, and I really need those.</p>
  
  <p>The code to build the list of dictionaries:</p>
  
  <pre><code>def rows_to_dict_list(cursor):
     columns = [i[0] for i in cursor.description]
     return [dict(zip(columns, row)) for row in cursor]
  </code></pre>