|   | 1 |  initial version  | 
Slice indexing works for both dense and sparse matrices :
sage: M=matrix(SR, 5, sparse=True) ; M[2, 1]=3 ; M[3,2]=5 ; M
[0 0 0 0 0]
[0 0 0 0 0]
[0 3 0 0 0]
[0 0 5 0 0]
[0 0 0 0 0]
sage: M[2:5, 1:4]
[3 0 0]
[0 5 0]
[0 0 0]
HTH,
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.