title: How to store an array in a dictionary using python
body: <p>I am currently attempting to modify a series of programs by utilizing dictionaries as opposed to arrays. I have columns of raw information in a file, which is then read into an ASCII csv file. I need to convert this file into a dictionary, so that it can be fed into another program.</p>
  
  <p>I used a numpy.genfromtxt to pull out the information i need from the csv file, following this format:</p>
  
  <pre><code>a,b,c,d = np.genfromtxt("file",delimiter = ',', unpack = true)
  </code></pre>
  
  <p>this step works completely fine.</p>
  
  <p>I then attempt to build a dictionary:</p>
  
  <pre><code>ouputDict = dict([a,a],[b,b],[c,c],[d,d])
  </code></pre>
  
  <p>As i understand it, this should make the <strong>key "a"</strong> in the dictionary a correspond to the <strong>array "a"</strong>.</p>
  
  <p>thus if:</p>
  
  <pre><code>a = [1,2,3,4]
  </code></pre>
  
  <p>then:</p>
  
  <pre><code>outputDict[a][0] = 1
  </code></pre>
  
  <p>However, when i attempt to create this dictionary i receive the following error:</p>
  
  <pre><code>TypeError: unhashable type: 'numpy.ndarray'
  </code></pre>
  
  <p>Why can't I construct an array in this fashion and what is the workaround, if any? Any help will be greatly appreciated!</p>