[SciPy-Dev] slices of sparse matrixes

Matt Terry matt.terry@gmail....
Tue Feb 7 12:27:00 CST 2012


Do scipy sparse matrixes have the same slicing semantics as numpy
arrays?  I would expect the same slice of a numpy array and a scipy
array to have the same shape.  In this simple test, they do not.  I'm
using scipy 0.10.

>>> d = numpy.zeros( (4,3) )
>>> s = scipy.sparse.lil_matrix(d)
>>> d[:,0].shape == s[:,0].shape
False

Bug or feature?

-matt


More information about the SciPy-Dev mailing list