SciPy

scipy.sparse.dia_matrix.astype

dia_matrix.astype(t)[source]