BUG: to_dense is broken · Issue #14647 · pandas-dev/pandas (original) (raw)
As of 1d6dbb, the behaviour, documentation, and signatures for to_dense
are widely inconsistent:
SparseArray: documentation is incorrect (we are not converting a SparseSeries
), and the fill
parameter is not even respected if you trace the code. Not sure why it was ever there in the first place.
SparseSeries: What is the purpose of sparse_only
? Not only is it not documented, but it also is inconsistent with SparseArray
behaviour.
SparseDataFrame: Perhaps the most intuitive of them all. Documentation is correct, and it has no unnecessary parameters like the other two do.
I propose that we change the to_dense
behaviour to match that of SparseDataFrame
. Take no arguments and just convert to a dense object with no questions asked.