staircase.StairsArray.sample#

StairsArray.sample(x) pandas.core.series.Series#

Takes a collection of Stairs instances and evaluates their values across a set of points.

Parameters
xscalar or vector data

The points at which to sample the Stairs instances. Must belong to the step function domain.

Returns
pandas.DataFrame

A dataframe, where rows correspond to the Stairs instances in the StairsArray. and columns correspond to the points in x.

Examples

../../_images/staircase-StairsArray-sample-1.png
>>> import staircase as sc
>>> stairs = sc.StairsArray([s2, s3])
>>> [s2.closed, s3.closed]
["left", "left]
>>> stairs.sample([2,3,4]))
     2    3    4
0  0.0 -1.0 -1.0
1  0.0  NaN -1.0