pandas / 0.25.0 / reference / api / pandas.dataframe.sparse.to_dense.html /

pandas.DataFrame.sparse.to_dense

sparse.to_dense(self)

Convert a DataFrame with sparse values to dense.

New in version 0.25.0.

Returns:
DataFrame

A DataFrame with the same values stored as dense arrays.

Examples

>>> df = pd.DataFrame({"A": pd.SparseArray([0, 1, 0])})
>>> df.sparse.to_dense()
   A
0  0
1  1
2  0

© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.DataFrame.sparse.to_dense.html