pandas.Series.sparse.fill_value#
- Series.sparse.fill_value[source]#
Elements in data that are fill_value are not stored.
For memory savings, this should be the most common value in the array.
See also
SparseDtypeDtype for data stored in
SparseArray.Series.value_countsReturn a Series containing counts of unique values.
Series.fillnaFill NA/NaN in a Series with a specified value.
Examples
>>> ser = pd.Series([0, 0, 2, 2, 2], dtype="Sparse[int]") >>> ser.sparse.fill_value 0 >>> spa_dtype = pd.SparseDtype(dtype=np.int32, fill_value=2) >>> ser = pd.Series([0, 0, 2, 2, 2], dtype=spa_dtype) >>> ser.sparse.fill_value 2