Stairs.
sample
(x, how='right')¶Evaluates the value of the step function at one, or more, points.
Technically the results of this function should be considered as \(\lim_{x \to z^{-}} f(x)\) or \(\lim_{x \to z^{+}} f(x)\), when how = ‘left’ or how = ‘right’ respectively. See A note on interval endpoints for an explanation.
The function should be called using parentheses. See example below.
Parameters: |
|
---|---|
Returns: | |
Return type: | float, or list of floats |
See also
Examples
>>> s1.plot()
>>> s1(3.5)
1
>>> s1([1, 2, 4.5, 6])
[1, 0, -1, 0]
>>> s1([1, 2, 4.5, 6], how='left')
[0, 1, -1, 0]