title: conditional slicing of scipy sparse matrix
body: <p>Apologies if this is a duplicate.</p>
  
  <p>I have got a large <code>coo_matrix</code> (say <code>x</code>) returned by another function, which I need to slice on rows matching conditions in a numpy array <code>a</code> with same number of rows and a single column (with binary values). </p>
  
  <p>I am using scipy.sparse.hstack([x,a]) to concatenate the two, in order to do something like this  </p>
  
  <pre><code>x1 = x[x[:,-1] == 0]
  x2 = x[x[:,-1] == 1]
  </code></pre>
  
  <p>but that fails with the following error.</p>
  
  <pre><code>TypeError: 'coo_matrix' object is not subscriptable 
  </code></pre>
  
  <p><code>x.toarray()</code> solution doesn't work due to <code>MemoryError</code>.</p>
  
  <p>Is there a way to do the above? I need the sliced matrices as <code>coo_matrix</code> in the end.</p>