staircase.Stairs.value_sums#
- Stairs.value_sums(dropna=True, group=True)#
Characterises the distribution of step function values with a series of their sums.
The result is a
pandas.Series
, indexed by the values of a the step function. The values of the series are the lengths of the intervals whose value is equal to the corresponding index.This method is analagous to
pandas.Series.value_counts()
over a continous domain.- Parameters
- dropnabool, default True
Indicates whether to include intervals where the step function is undefined
- groupbool, default True
Indicates whether to group the index values together into a unique index.
- Returns
Examples
>>> s1.plot()
>>> s1.value_sums() -1 1 0 1 1 2 dtype: int64
>>> s3.plot()
>>> s3.value_sums(dropna=False) -1.0 1.0 0.0 0.5 1.0 1.5 NaN 1.0 dtype: float64