title: calculate coordinates of blocks in diagonal block matrix
body: <p>I have a diagonal block <a href="http://dl.dropbox.com/s/1p4nuxemwiss37d/diag%20block.png?dl=0" rel="nofollow">matrix</a> and I want the coordinates (row, column) of each block</p>
  
  <pre><code>a = np.zeros((25,18), dtype=int)    
  a[2:8,:6]=1
  
  a[8:13,6:12]=1
  
  a[13:15,12:14]=1
  
  a[15:20,14:]=1
  </code></pre>
  
  <p>and the output </p>
  
  <pre><code> [(2, 0), (8, 6), (13, 12), (15, 14)]
  </code></pre>
  
  <p>Thanks!</p>