SciPy

scipy.sparse.csr_matrix.asfptype

csr_matrix.asfptype()[source]

Upcast matrix to a floating point format (if necessary)