title: Python Matrix overlap
body: <p>I have an problem with overlapping matrices</p>
  
  <pre><code>import numpy as np
  import pprint
  
  A = np.array([[1,0],[0,1]])
  B = np.array([[0,0,0],[0,0,0],[0,0,0]])
  
  for i in range(0,2):
      for j in range(0,2):
          if i==0:
              if j&lt;2:
                  B[i,j]=A[i,j]
          elif i==2:
              if j==2:
                  B[i,j]=A[i,j]
          else:
              B[i,j] = A[i,j] + A[i-1,j-1]
  
  pprint.pprint(B)
  </code></pre>
  
  <p>and it returns array like this <code>([[1,0,0],[0,2,0],[0,0,0]])</code> but i want <code>([[1,0,0],[0,2,0],[0,0,1]])</code></p>
  
  <p>what is wrong with my code?</p>
  
  <p>please help.</p>