staircase.Stairs.resample

Stairs.resample(x, how='right')

Evaluates the value of the step function at one, or more, points and creates a new Stairs instance whose step changes occur at a subset of these points. The new instance and self have the same values when evaluated at x.

Parameters:
  • x (int, float or vector data) – values at which to evaluate the function
  • how ({'left', 'right'}, default 'right') – if points where step changes occur do not coincide with x then this parameter has no effect. Where a step changes 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.
Returns:

Return type:

Stairs

See also

staircase.resample()

Examples

>>> stair_list = [s1, s1.resample([1.5,2.5,4,4.5])]
>>> fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12,5), sharey=True, sharex=True)
>>> for ax, title, stair_instance in zip(axes, ("s1", "s1 resampled"), stair_list):
...     stair_instance.plot(ax)
...     ax.set_title(title)
../_images/staircase-Stairs-resample-1.png