title: storing matrices computed out of two for loops (appending a list did not work)
body: <p>i am implementing the Jacobi iterative method</p>
  
  <p>The problem is i can not store the calculated matrix after each iteration, i tried to append into an empty list but it keeps overwriting the previous elements in that list and i end up with a single matrix repeated K times.</p>
  
  <p>I need to subtract and operate on those matrices for convergence criteria </p>
  
  <pre><code># Iterate Jacobi until convergence  
  U = np.array([[8.9,8.9,8.9,8.9,8.9],[8.4,0,0,0,9.2],[7.2,0,0,0,9.4],[6.1,6.8,7.7,8.7,6.1]])
  UI=U
  UF=U
  UFK=[]
  k=0
  while k&lt;3:
      k=k+1 # update the iteration counter
      for i in range (1,Nx-1):
          for j in range (1,Ny-1):
              UF[j,i] = (UI[j+1,i]+UI[j,i+1]+UI[j-1,i]+UI[j,i-1])*0.25 #the matrix i want to store after each iteration 
      UFK.append(UF) # 
      print (UF) # when i print UF i get the correct matrix at each iteration displayed 
  
  [[ 8.9         8.9         8.9         8.9         8.9       ]
   [ 8.4         4.325       3.30625     5.3515625   9.2       ]
   [ 7.2         4.58125     3.896875    6.83710938  9.4       ]
   [ 6.1         6.8         7.7         8.7         6.1       ]]
  [[ 8.9         8.9         8.9         8.9         8.9       ]
   [ 8.4         6.296875    6.11132812  7.76210937  9.2       ]
   [ 7.2         6.0484375   6.67421875  8.13408203  9.4       ]
   [ 6.1         6.8         7.7         8.7         6.1       ]]
  [[ 8.9         8.9         8.9         8.9         8.9       ]
   [ 8.4         7.36494141  7.67531738  8.47734985  9.2       ]
   [ 7.2         7.00979004  7.62979736  8.5517868   9.4       ]
   [ 6.1         6.8         7.7         8.7         6.1       ]]
  
  print(UFK) # when i display the appended UFK it is just repeating a single matrix 3 times
  
  [array([[ 8.9       ,  8.9       ,  8.9       ,  8.9       ,  8.9       ],
          [ 8.4       ,  7.36494141,  7.67531738,  8.47734985,  9.2       ],
          [ 7.2       ,  7.00979004,  7.62979736,  8.5517868 ,  9.4       ],
          [ 6.1       ,  6.8       ,  7.7       ,  8.7       ,  6.1       ]]),
   array([[ 8.9       ,  8.9       ,  8.9       ,  8.9       ,  8.9       ],
          [ 8.4       ,  7.36494141,  7.67531738,  8.47734985,  9.2       ],
          [ 7.2       ,  7.00979004,  7.62979736,  8.5517868 ,  9.4       ],
          [ 6.1       ,  6.8       ,  7.7       ,  8.7       ,  6.1       ]]),
   array([[ 8.9       ,  8.9       ,  8.9       ,  8.9       ,  8.9       ],
          [ 8.4       ,  7.36494141,  7.67531738,  8.47734985,  9.2       ],
          [ 7.2       ,  7.00979004,  7.62979736,  8.5517868 ,  9.4       ],
          [ 6.1       ,  6.8       ,  7.7       ,  8.7       ,  6.1       ]])]
  </code></pre>