Slice border of 2D NumPy array by integer value
<p>I would like to slice a 2D NumPy array by an integer value, but I cannot find a way to do this properly. I need to slice the "border" of the matrix by a certain number of rows/columns.</p>

<p>Say the array is:</p>

<pre><code>a = np.reshape(np.arange(25),(5,5))
print a

[[ 0  1  2  3  4]
 [ 5  6  7  8  9]
 [10 11 12 13 14]
 [15 16 17 18 19]
 [20 21 22 23 24]]

slice_val = 1

b = a[:-slice_val,:-slice_val]
print "\n", b
</code></pre>

<p>What I get is:</p>

<pre><code>[[ 0  1  2  3]
 [ 5  6  7  8]
 [10 11 12 13]
 [15 16 17 18]]
</code></pre>

<p>, but I want something like this:</p>

<pre><code>[[6  7  8 ]
 [11 12 13]
 [16 17 18]]
</code></pre>