title: Sum of 8 neighbors in 2d array
body: <p>I need to find the sum of all the neighboring elements of a cell, say <code>getsumofneighbors(matrix, i, j)</code>:</p>
  
  <pre><code>'M*N matrix'
  [[0 1 0]
   [2 0 1]
   [0 4 0]
   [0 0 0]]
  </code></pre>
  
  <p>sum of nearest elements of cell <code>[0][0]</code> is 3 </p>
  
  <p>at <code>[1][0]</code> is 5</p>
  
  <p>and at <code>[1][1]</code> is 8</p>
  
  <p>Is there a python lib to find the sum of all the elements next to the given cell?</p>