scipy.sparse
scipy.sparse.spmatrix.reshape
scipy.sparse.spmatrix.setdiag
spmatrix.
set_shape
See reshape.
reshape