scipy.sparse
dia_matrix.
set_shape
See reshape.
reshape
scipy.sparse.dia_matrix.rint
scipy.sparse.dia_matrix.setdiag