staircase.StairsSlicer.integral#

StairsSlicer.integral()#

Calculates the integral of each step function slice

Returns
pandas.Series

Examples

>>> df = sc.make_test_data(seed=0)
>>> sf = sc.Stairs(df, "start", "end", "value")
>>> sf.plot()
../../_images/staircase-StairsSlicer-integral-1.png
>>> sf.slice(pd.date_range("2021", periods=12, freq="MS")).integral()
[2021-01-01, 2021-02-01)   13542 days 23:01:00
[2021-02-01, 2021-03-01)   10481 days 09:38:00
[2021-03-01, 2021-04-01)   15554 days 22:10:00
[2021-04-01, 2021-05-01)   15077 days 19:36:00
[2021-05-01, 2021-06-01)   12276 days 06:57:00
[2021-06-01, 2021-07-01)   11957 days 16:03:00
[2021-07-01, 2021-08-01)   15140 days 17:34:00
[2021-08-01, 2021-09-01)   14754 days 17:45:00
[2021-09-01, 2021-10-01)   13165 days 09:55:00
[2021-10-01, 2021-11-01)   14376 days 03:32:00
[2021-11-01, 2021-12-01)   14222 days 11:29:00
dtype: timedelta64[ns]