pandas.Series.to_sparse

Series.to_sparse(kind='block', fill_value=None)[source]

Convert Series to SparseSeries

Parameters:

kind : {‘block’, ‘integer’}

fill_value : float, defaults to NaN (missing)

Returns:

sp : SparseSeries