title: Write 2d dictionary into a dataframe or tab-delimited file using python
body: <p>I have a 2-d dictionary in the following format:</p>
  
  <pre><code>myDict = {('a','b'):10, ('a','c'):20, ('a','d'):30, ('b','c'):40, ('b','d'):50,('c','d'):60}
  </code></pre>
  
  <p>How can I write this into a tab-delimited file so that the file contains the following. While filling a tuple (x, y) will fill two locations: (x,y) and (y,x).  (x,x) is always 0. </p>
  
  <p>The output would be :</p>
  
  <pre><code>    a   b   c   d
  a   0   10  20  30
  b   10  0   40  50
  c   20  40  0   60
  d   30  50  60  0 
  </code></pre>
  
  <p>PS: If somehow the dictionary can be converted into a dataframe (using pandas) then it can be easily written into a file using pandas function</p>