pandas.SparseArray.density
-
SparseArray.density
-
The percent of non-
fill_value
points, as decimal.Examples
>>> s = SparseArray([0, 0, 1, 1, 1], fill_value=0) >>> s.density 0.6
© 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.24.2/reference/api/pandas.SparseArray.density.html