title: Defining a specific loop in Python
body: <p>I am trying to define a loop where at <code>t=1</code>, <code>sigma(1)=v(0)*1+1</code>. In other words, I want <code>sigma</code> at the current time step to take <code>v</code> of the previous time step. <code>v</code> is related to <code>sigma</code> through <code>v=sigma*R</code>.</p>
  <p>The current and desired outputs are attached.</p>
  <pre><code>import numpy as np
  N=2
  ar1 = []
  ar2 = []
  v=np.zeros((3,3))
  
  R=np.array([[1.1,1.2,1.3],[1.4,1.5,1.6],[1.7,1.8,1.9]])
  
  for t in range(0,N):
      
      sigma = v*t+1
      ar1.append(sigma)
      I1=np.array(ar1)
      
      v=sigma*R
      ar2.append(v)
      I2=np.array(ar2)
  
  print(&quot;I1 =&quot;,[I1])
  print(&quot;I2 =&quot;,[I2])
  </code></pre>
  <p>The current output is</p>
  <pre><code>I1 = [array([[[1. , 1. , 1. ],
          [1. , 1. , 1. ],
          [1. , 1. , 1. ]],
  
         [[2.1, 2.2, 2.3],
          [2.4, 2.5, 2.6],
          [2.7, 2.8, 2.9]]])]
  
  I2 = [array([[[1.1 , 1.2 , 1.3 ],
          [1.4 , 1.5 , 1.6 ],
          [1.7 , 1.8 , 1.9 ]],
  
         [[2.31, 2.64, 2.99],
          [3.36, 3.75, 4.16],
          [4.59, 5.04, 5.51]]])]
  </code></pre>
  <p>The desired output is</p>
  <pre><code>I1 = [array([[[1. , 1. , 1. ],
          [1. , 1. , 1. ],
          [1. , 1. , 1. ]],
  
         [[1.1, 1.2, 1.3],
          [1.4, 1.5, 1.6],
          [1.7, 1.8, 1.9]]])]
  
  I2 = [array([[[1.1 , 1.2 , 1.3 ],
          [1.4 , 1.5 , 1.6 ],
          [1.7 , 1.8 , 1.9 ]],
  
         [[1.21, 1.44, 1.69],
         [1.96, 2.25, 2.56],
         [2.89, 3.24, 3.61]]])]
  </code></pre>