staircase.StairsSlicer.median#
- StairsSlicer.median()#
Calculates the median of each step function slice
- Returns:
Examples
>>> df = sc.make_test_data(seed=0) >>> sf = sc.Stairs(df, "start", "end", "value") >>> sf.plot()
>>> sf.slice(pd.date_range("2021", periods=12, freq="MS")).median() [2021-01-01, 2021-02-01) 442.0 [2021-02-01, 2021-03-01) 375.0 [2021-03-01, 2021-04-01) 509.0 [2021-04-01, 2021-05-01) 508.0 [2021-05-01, 2021-06-01) 384.0 [2021-06-01, 2021-07-01) 387.0 [2021-07-01, 2021-08-01) 486.0 [2021-08-01, 2021-09-01) 482.0 [2021-09-01, 2021-10-01) 435.0 [2021-10-01, 2021-11-01) 462.0 [2021-11-01, 2021-12-01) 474.0 dtype: float64