pandas.Series.sparse.density#
- Series.sparse.density[源代码]#
非
fill_value
点的百分比,以小数表示。参见
DataFrame.sparse.from_spmatrix
Create a new DataFrame from a scipy sparse matrix.
例子
>>> from pandas.arrays import SparseArray >>> s = SparseArray([0, 0, 1, 1, 1], fill_value=0) >>> s.density 0.6