title: How do I remove the first and last rows and columns from a 2D numpy array?
body: <p>I'd like to know how to remove the first and last rows and columns from a 2D array in numpy. For example, say we have a <code>(N+1) x (N+1)</code> matrix called <code>H</code> then in MATLAB/Octave, the code I'd use would be:</p>
  
  <pre><code>Hsub = H(2:N,2:N);
  </code></pre>
  
  <p>What's the equivalent code in Numpy? I thought that <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.reshape.html" rel="noreferrer"><code>np.reshape</code></a> might do what I want but I'm not sure how to get it to remove just the target rows as I think if I reshape to a <code>(N-1) x (N-1)</code> matrix, it'll remove the last two rows and columns. </p>