title: Convert list to dictionary, with key and value from list
body: <p>Sorry if a repeated question, new to programming couldn't find any appropriate answer. I am trying to convert a list to dictionary. key  being x[1] and values as x[2]</p>
  
  <p>Just to be clear I have a n*3 array and need to convert it to a dictionary with 2nd column as keys and 3rd column as values. </p>
  
  <p>I tried:</p>
  
  <pre><code>for entry in data:
       keys=entry[1]
       values=entry[2]
  
  source = dict.fromkeys(keys, values)
  </code></pre>
  
  <p>got error 'type list not hashable'</p>
  
  <p>Went through question 4576115. However, I need to iterate through each element of a 3000+ *3 array with most elements themselves being list and thereafter setting the 2nd element of each entry as a key and the 3rd as a value. just to amplify, also tried</p>
  
  <pre><code>b = {data[i][1]: data[i][2] for i in range(0, len(data))}
  </code></pre>
  
  <p>and  for entry in data:</p>
  
  <pre><code>keys=entry[1]
  values=entry[2]
  b.update(keys,values)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>keyList.append(keys)
  valueList.append(values)
  b = dict(zip(keyList,valueList))
  </code></pre>
  
  <p>and</p>
  
  <pre><code>b={entry[1]:entry[2] for entry in data} 
  </code></pre>
  
  <p>same issue- error 'list' not hashable</p>
  
  <p>OK sorry. Got it. The issue is that the key themselves are lists. I was looking at the array and missed the element</p>