title: Converting a python 3 dictionary into a dataframe (keys are tuples)
body: <p>I have a dictionary that has the following structure:</p>
  
  <pre><code>Dict [(t1,d1)] = x
  </code></pre>
  
  <p>(x are integers, t1 and d1 are strings)</p>
  
  <p>I want to convert this Dictionary into a dataframe of the following format:</p>
  
  <pre><code>   d1 d2 d3 d4
  t1  x y  z  x
  t2  etc.
  t3
  t4
  ...
  </code></pre>
  
  <p>The following command </p>
  
  <p>d.DataFrame([[key,value] for key,value in Dict.items()],columns=["key_col","val_col"])</p>
  
  <p>gives me </p>
  
  <p>key_col  val_col</p>
  
  <p>0  (book, d1)      100</p>
  
  <p>1   (pen, d1)       10</p>
  
  <p>2  (book, d2)       30</p>
  
  <p>3   (pen, d2)        0</p>
  
  <p>How do I make d's my column names and t's my row names?</p>