I want to convert a pandas SparseDataFrame
to a scipy.sparse.csc_matrix
. But I don't want to convert it back to a dense matrix first.
Right now I have something like the below.
df = pd.get_dummies(df, sparse=True)
Basically what I need is to further get a scipy.sparse.csc_matrix
from df
. Is there a way to do it?