title: How to access the adjacent cells of each elements of matrix in python?
body: <p>Here two cells are considered adjacent if they share a boundary. 
  For example :</p>
  
  <pre><code>A = 5 6 4
      2 1 3
      7 9 8
  </code></pre>
  
  <p>Here adjacent elements to index 0,0 is at index [0,1] and [1,0] and for index 1,1 the adjacent elements are at index [0,1],[1,0],[2,1] and [1,2].</p>