scipy/scipy — pull request #2689 by cowlicks (2013-08-05 04:04:52+00:00)
Title: Fancy indexing for CSR and CSC matrices. 

This is based off of @daniel-b-smith's work (thanks!).

I also add support for indexing with sparse boolean matrices, but it does not have tests yet. I will add tests for this tomorrow. For now I just wanted to get this out because it finishes what Daniel started.

Here's a demo of what I mean by indexing with sparse boolean matrices.
```
>>> from scipy.sparse import csr_matrix
>>> from numpy.random import randint

>>> x = csr_matrix(randint(6, size=(4,4)))
>>> x.todense()

matrix([[3, 5, 0, 4],
[4, 3, 4, 0],
[0, 3, 2, 0],
[2, 2, 0, 1]], dtype=int64)

>>> x[x > 3] = 1
>>> x.todense()

matrix([[3, 1, 0, 1],
[1, 3, 1, 0],
[0, 3, 2, 0],
[2, 2, 0, 1]], dtype=int64)

```