How do I extract a sub-array from a numpy 2d array?
<p>I'd like to extract a numpy array with a specified size from a numpy 2d array--essentially I want to crop the array.
For example, if have a numpy array like this:</p>

<pre><code>([1,2,3],
 [4,5,6],
 [7,8,9])
</code></pre>

<p>I'd like to extract a 2x2 from it and the result should be:</p>

<pre><code>([1,2],
 [4,5])
</code></pre>

<p>How can I do that?</p>