staircase.Stairs.percentile

Stairs.percentile(x, lower=-inf, upper=inf)

Calculates the x-th percentile of the step function.

Parameters:
  • lower (int, float or pandas.Timestamp) – lower bound of the interval on which to perform the calculation
  • upper (int, float or pandas.Timestamp) – upper bound of the interval on which to perform the calculation
Returns:

The x-th percentile of the step function

Return type:

float

Examples

>>> fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12,5))
>>> s2.plot(axes[0])
>>> axes[0].set_title("s2")
>>> s2_percentiles = s2.percentile_stairs()
>>> s2_percentiles.plot(axes[1])
>>> axes[0].set_title("s2 percentiles")
>>> s2_percentiles(55)
0.0
>>> s2_percentiles(75)
0.5
../_images/staircase-Stairs-percentile-1.png