pandas.Series.sparse.density#

Series.sparse.density[source]#

The percent of non- fill_value points, as decimal.

See also

DataFrame.sparse.from_spmatrix

Create a new DataFrame from a scipy sparse matrix.

Examples

>>> from pandas.arrays import SparseArray
>>> s = SparseArray([0, 0, 1, 1, 1], fill_value=0)
>>> s.density
0.6