Home > Mobile >  How to "un-sparse" a dataframe
How to "un-sparse" a dataframe

Time:09-27

I have a dataframe which its dtypes is :

Sparse [int, 0]

How can I "un-sparse" it? i.e. converting it to dtype of regular int?

I have tried .astype(int) but it does not cancel the sparse.

CodePudding user response:

Try using df.sparse.to_dense()

Doc

  • Related