How to set default fill value for sparse data frame after removal of pd.SpraseDataFrame?

Viewed 278

In the past it was pssible to do

pd.SparseDataFrame(some_sparse_matrix, default_fill_value=some_value)

This will be removed:

FutureWarning: SparseDataFrame is deprecated and will be removed in a future version. Use a regular DataFrame whose columns are SparseArrays instead.

See http://pandas.pydata.org/pandas-docs/stable/user_guide/sparse.html#migrating for more.

The help page for migrating code says:

The SparseDataFrame.default_kind and SparseDataFrame.default_fill_value attributes have no replacement.

So, what is the best way to define a default fill value on the future?

0 Answers
Related