slicing sparse (scipy) matrix
问题 I would appreciate any help, to understand following behavior when slicing a lil_matrix (A) from the scipy.sparse package. Actually, I would like to extract a submatrix based on an arbitrary index list for both rows and columns. When I used this two lines of code: x1 = A[list 1,:] x2 = x1[:,list 2] Everything was fine and I could extract the right submatrix. When I tried to do this in one line, it failed (The returning matrix was empty) x=A[list 1,list 2] Why is this so? Overall, I have used