title: Assign a list of values to a numpy array
body: <p>Suppose there is a 2-dimensional <code>numpy</code> array of shape <code>(10000, 100)</code> and size <code>1000000</code>. There is also a 1-dimensional <code>list</code> of length <code>1000000</code>. What would be the fastest way to assign all the values in the list to the array? My solution is:</p>
  
  <pre><code>my_array = np.zeros([10000, 100]) 
  my_list = range(1000000)
  length_of_list = len(my_list)
  
  for i in range(length_of_list):                  
      my_array.flat[i] = my_list[i]
  </code></pre>
  
  <p>Is there maybe a better one?</p>