staircase.Stairs.percentile

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

Calculates the x-th percentile of the step function’s values

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

Return type:

float

Examples

>>> s1.plot()
>>> s1.percentile(70)
1.0
>>> s1.percentile(25)
-0.5
>>> s1.percentile(40, lower=1.5, upper=3.5)
0.0
../_images/staircase-Stairs-percentile-1.png