title: Getting Table from MySQL as dict with two keys in Python
body: <p>i got a table in MySQL looking like this:</p>
  
  <p><code>ID   FP  VSN  HSN
   1    xxx 1,5  1,8
   2    yyy 1,1  2,1</code></p>
  
  <p>Now, I'm trying to retrieve the values from the table in Python and save them in a dict <code>n[ID,/Column Name/]</code> using MySQL-Connector</p>
  
  <p>So far I tried unsuccessfully:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>mycursor1=conn.cursor(dictionary=True)
  
  query1 = ("SELECT * FROM `result`")
  
  mycursor1.execute(query1)
  
  columns = mycursor1.description
  
  n = {}
  
  for row in mycursor1:
    for c in columns:
      n[row["ID",c[0]] = float(row[c])
      
  mycursor1.close</code></pre>
  </div>
  </div>
  </p>
  
  <p>The result in this case should look like this:</p>
  
  <p><code>n[1,VSN] = 1,5
   n[1,HSN] = 1,8
   n[2,VSN] = 1,1 
   n[2,HSN] = 2,1</code> </p>
  
  <p>Thanks a lot in advance!</p>