SciPy

scipy.sparse.dok_matrix.astype

dok_matrix.astype(t)[source]