title: How to extract the first x digits out of a matrix?
body: <p>I would like to extract the first 5 digits out of a given nxm matrix.</p>
  
  <p>For example the 3x3 Matrix A </p>
  
  <pre><code>A = [[ 1.  2.  3. ]
       [ 4.  5.  6.]
       [ 8.  9.  10.]]
  </code></pre>
  
  <p>The first 5 digits would be 1,2,3,4,5, so the first row and the half of the second.</p>
  
  <p>The big problem is to do that without using too much resources, the brute force solution is too expensive.</p>