scipy/scipy — pull request #3468 by pv (2014-03-18 19:57:48+00:00)
Title: BUG: sparse: fix backward compatibility issues in scipy.sparse vs 64-bit indices

This PR fixes two backward compat issues regarding 64-bit indices in scipy.sparse:

- `csr_matrix.__getitem__` inherited the integer type from the fancy index array. Fixed by casting to int32 when possible.
- scikit-learn, and presumably other libraries, implicitly assume that 64-bit indices passed to sparse matrix constructors are cast to 32-bit indices. Address this by casting int64 to int32 in CSR/CSC/BSR constructor, if the contents of the array can be represented in 32-bit.

Fixes gh-3465 --- scikit-learn test suite passes for me after these changes.