staircase.Stairs.limit#

Stairs.limit(x, side, include_index=False) pandas.core.series.Series#

Evaluates the limit of the step function as it approaches one, or more, points.

The results of this function should be considered as \(\lim_{x \to z^{-}} f(x)\) or \(\lim_{x \to z^{+}} f(x)\), when side = ‘left’ or side = ‘right’ respectively. See A note on interval endpoints for an explanation.

Parameters
xint, float or vector data

Values at which to evaluate the function

side{‘left’, ‘right’}, default ‘right’

If points where step changes occur do not coincide with x then this parameter has no effect. Where a step change occurs at a point given by x, this parameter determines if the step function is evaluated at the interval to the left, or the right.

include_indexbool, default False

Indicates if the values returned should be a numpy.ndarray, or in a pandas.Series indexed by the values in x

Returns
float, numpy.ndarray, pandas.Series

Examples

>>> s3.plot(arrows=True)
../../_images/staircase-Stairs-limit-1.png
>>> s3.limit(2, side="left")
1.0
>>> s3.limit(2, side="right")
0.0
>>> s3.limit([2, 2.5, 3.5], side="right")
array([ 0., nan,  1.])