title: Sub matrix of a list of lists (without numpy)
body: <p>Suppose I have a matrix composed of a list of lists like so:</p>
  
  <pre><code>&gt;&gt;&gt; LoL=[list(range(10)) for i in range(10)]
  &gt;&gt;&gt; LoL
  [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]
  </code></pre>
  
  <p>Assume, also, that I have a numpy matrix of the same structure called <code>LoLa</code>:</p>
  
  <pre><code>&gt;&gt;&gt; LoLa=np.array(LoL)
  </code></pre>
  
  <p>Using numpy, I could get a submatrix of this matrix like this:</p>
  
  <pre><code>&gt;&gt;&gt; LoLa[1:4,2:5]
  array([[2, 3, 4],
         [2, 3, 4],
         [2, 3, 4]])
  </code></pre>
  
  <p>I can replicate the numpy matrix slice in pure Python like so:</p>
  
  <pre><code>&gt;&gt;&gt; r=(1,4)
  &gt;&gt;&gt; s=(2,5)
  &gt;&gt;&gt; [LoL[i][s[0]:s[1]] for i in range(len(LoL))][r[0]:r[1]]
  [[2, 3, 4], [2, 3, 4], [2, 3, 4]] 
  </code></pre>
  
  <p>Which is not the easiest thing in the world to read nor the most efficient :-)</p>
  
  <p>Question: Is there an easier way (in pure Python) to slice an arbitrary matrix as a sub matrix?</p>