title: Add a vector to array
body: <p>A really stupid question, but I could not figure the right way.. </p>
  
  <ol>
  <li>A is a 2 by 2 matrix, and B is a 2 by 1 matrix.  </li>
  <li>In a 10 iterations loop, B_new=A*B. B_new is 2 by 1.</li>
  <li>Save B_new to an output matrix B_final after each iteration. So in the end, B_final is 2 by 10.</li>
  </ol>
  
  <p>However, I have problem of adding B to B_new in a loop. Below is my code, can anyone give me some suggestions?</p>
  
  <pre><code>import numpy as np
  a=np.ones(shape=(2,2))
  b=np.ones(shape=(2,1))     
  c_final=np.zeros(shape=(2,10)) 
  
  for i in range(0,10):
      c=np.dot(a,b)
      b=c
      c_final[:,i]=c
  </code></pre>
  
  <p>Here is the error message:</p>
  
  <pre><code>    c_final[:,i]=c
  ValueError: output operand requires a reduction, but reduction is not enabled
  </code></pre>