scipy.sparse
scipy.sparse.dok_matrix.resize
scipy.sparse.dok_matrix.setdefault
dok_matrix.
set_shape
See reshape.
reshape