scipy.sparse.dia_matrix.format

dia_matrix.format = 'dia'