title: Sparse matrix slicing using list of int
body: <p>I'm writing a machine learning algorithm on huge &amp; sparse data (my matrix is of shape (347, 5 416 812 801) but very sparse, only 0.13% of the data is non zero. </p>
  
  <p>My sparse matrix's size is 105 000 bytes (&lt;1Mbytes) and is of <code>csr</code> type.</p>
  
  <p>I'm trying to separate  train/test sets by choosing a list of examples indices for each.
  So I want to split my dataset in two using :</p>
  
  <pre><code>training_set = matrix[train_indices]
  </code></pre>
  
  <p>of shape <code>(len(training_indices), 5 416 812 801)</code>, still sparse</p>
  
  <pre><code>testing_set = matrix[test_indices]
  </code></pre>
  
  <p>of shape <code>(347-len(training_indices), 5 416 812 801)</code> also sparse</p>
  
  <p>With <code>training_indices</code> and <code>testing_indices</code> two <code>list</code> of <code>int</code></p>
  
  <p>But <code>training_set = matrix[train_indices]</code> seems to fail and return a <code>Segmentation fault (core dumped)</code></p>
  
  <p>It might not be a problem of memory, as I'm running this code on a server with 64Gbytes of RAM.</p>
  
  <p>Any clue on what could be the cause ?</p>