staircase.StairsSlicer.mode¶
- StairsSlicer.mode()¶
Calculates the mode 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")).mode() [2021-01-01, 2021-02-01) 469.0 [2021-02-01, 2021-03-01) 354.0 [2021-03-01, 2021-04-01) 578.0 [2021-04-01, 2021-05-01) 532.0 [2021-05-01, 2021-06-01) 371.0 [2021-06-01, 2021-07-01) 372.0 [2021-07-01, 2021-08-01) 452.0 [2021-08-01, 2021-09-01) 485.0 [2021-09-01, 2021-10-01) 425.0 [2021-10-01, 2021-11-01) 452.0 [2021-11-01, 2021-12-01) 471.0 dtype: float64