title: Convert psycopg2 DictRow query to Pandas dataframe
body: <p>I would like to convert a <a href="http://initd.org/psycopg/docs/extras.html#dictionary-like-cursor" rel="noreferrer">psycopg2 <code>DictRow</code></a> query to a pandas dataframe, but pandas keeps complaining:</p>
  
  <pre><code>curs = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
  curs.execute("SELECT * FROM mytable")
  data = curs.fetchall()
  
  print type(data)
  print pd.DataFrame(list(data))
  </code></pre>
  
  <p>However, I always get an error although I specifically passed a <code>list</code>???</p>
  
  <pre><code>&lt;type 'list'&gt;
  TypeError: Expected list, got DictRow
  </code></pre>
  
  <p>The result is the same if I do <code>pd.DataFrame(data)</code> Could someone please help me make this work?</p>
  
  <p>It would also be nice if the column names of the dataframe worked (i.e. extract <code>DictRow</code> and pass them to the dataframe).</p>
  
  <p><strong>Update:</strong><br>
  Since I need to process the data, I would like to use the data from the psycopg2 query as is and not the <a href="https://stackoverflow.com/a/31474021/2075003">pandas approach</a>, e.g. <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_sql_query.html" rel="noreferrer"><code>read_sql_query</code></a>. </p>