writing some numbers into csv like comparision matrix
<p>I am using python to write some comparison value as below mentioned:</p>

<pre><code>ids = [1, 2, 3] 
vals = [0.0, 0.71, 0.89, 0.71, 0.0, 0.77, 0.89, 0.77, 0.0]
</code></pre>

<p>where ids are id_number (int) of 3 chemical compounds derived from a database and vals are comparison values with each others ......but I want these ids and vals TO BE WRITTEN INTO A CSV FILE like below:</p>

<pre>
    1        2        3

1   0.0      0.71     0.89 

2   0.71     0.0      0.77

3   0.89     0.77     0.0
</pre>

<p>ONLY UPPER OR LOWER TRINGULAR MATRIX WRIITEN INTO CSV WILL BE BETTER</p>
