SciPy

scipy.sparse.csc_matrix.astype

csc_matrix.astype(t)[source]

Cast the matrix elements to a specified type.

The data will be copied.

Parameters:

t : string or numpy dtype

Typecode or data-type to which to cast the data.