title: Copying values of a numpy array into specific location of sparse matrix
body: <p>So I am trying to copy values from one numpy array into a sparse matrix. The first array looks like this:</p>
  
  <pre><code>results_array = [[  3.00000000e+00   1.00000000e+00   4.00000000e+00   1.00000000e+03]
  [  6.00000000e+00   2.00000000e+00   5.00000000e+00   7.00000000e+02]
  [  1.60000000e+01   4.00000000e+00   8.00000000e+00   1.00000000e+03]}
  </code></pre>
  
  <p>The second value (or <code>results_array[i][1]</code>) dictates the column id, the third value (<code>results_array[i][2]</code>) dictates the row id and the fourth value (<code>results_array[i][3]</code>) dictates the value of that row, column pair.  </p>
  
  <p>So far what I have is this:</p>
  
  <pre><code>for i in result_array:
  sparse_matrix = csc_matrix((i[3],(i[1],i[2])), shape=(14,14))
  print "last array", sparse_matrix
  </code></pre>
  
  <p>The output I get is:</p>
  
  <pre><code>File "C:/Users/Andrew/Google Drive/Uni/Final Year/Research Project/Programming/Mine/First UEA/xl_optim/Runestone 2.py", line 13, in &lt;module&gt;
  sparse_matrix = csc_matrix((i[3],(i[1],i[2])), shape=(14,14))
  File "C:\Users\Andrew\Anaconda2\lib\site-packages\scipy\sparse\compressed.py", line 48, in __init__
  other = self.__class__(coo_matrix(arg1, shape=shape))
  File "C:\Users\###\Anaconda2\lib\site-packages\scipy\sparse\coo.py", line 182, in __init__
  self._check()
  File "C:\Users\###\Anaconda2\lib\site-packages\scipy\sparse\coo.py", line 219, in _check
  nnz = self.nnz
  File "C:\Users\###\Anaconda2\lib\site-packages\scipy\sparse\coo.py", line 194, in getnnz
  nnz = len(self.data)
  TypeError: len() of unsized object
  </code></pre>
  
  <p>I think I need to create the sparse matrix first and then add the values to it iteratively (I'm imagining something like a <code>.append</code> but to a specific location in the matrix) but I have no idea how to create an empty sparse matrix and then assign values to it.  </p>
  
  <p>Let me know if you need further clarification.  Thanks!</p>