DEPR: deprecate Series/DataFrame.to_dense/to_sparse · Issue #26557 · pandas-dev/pandas (original) (raw)
We should properly deprecate to_dense
and to_sparse
on Series and DataFrame.
Series.to_dense
already is disfunctional (#25680), and DataFrame.to_dense
can be replaced with DataFrame.sparse.to_dense()
.
And the to_sparse
methods return a SparseSeries / SparseDataFrame, which are deprecated (and in that sense already show some deprecation warning, but this should be done properly with their own deprecation warning and doc update).
Those could in principle be replaced with a new DataFrame/Series.sparse.to_sparse
method? (although you can already do astype('Sparse')
)