API: Always return DataFrame from get_dummies by TomAugspurger · Pull Request #24284 · pandas-dev/pandas (original) (raw)

xref #19239

In preparation for hopefully deprecating SparseDataFrame / SparseSeries. Right now, I've just made this an API breaking change.

If we want to do this via deprecation, we'd need a new keyword argument to control the result type. I opted against that, because to get a warning-free get_dummies people would need

pd.get_dummies(..., sparse=True, result_type=None/'sparse_dataframe'/'dataframe'): ...

IMO, that's too big a burden for the common case, but would be curious to hear others' thoughts here.