[SciPy-dev] better sparse slicing

Nathan Bell wnbell at gmail.com
Thu Feb 14 03:42:57 EST 2008


I've expanded on Robert C's earlier efforts in improving the state of
sparse slicing.

Previously you could do
A[1]
A[1:2]
A[1:2,1]
A[1:2,1:2]

Now you can do:
A[[1,2]]
A[1:2,[1,2]]
A[[1,2],1:2]
A[[1,2],[1,2]]

and the all important:
A[[1,2],:][:,[1,2]]


Currently this only works for csr_matrix (and not csc_matrix).  Once I
trust my csr_matrix implementation I'll make csc_matrix work also.
The above operations should mimic numpy.matrix exactly.

-- 
Nathan Bell wnbell at gmail.com
http://graphics.cs.uiuc.edu/~wnbell/



More information about the SciPy-Dev mailing list