staircase.core.arrays.accessor.StairsAccessor.sample#

StairsAccessor.sample(x)#

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 pandas.Series. and columns correspond to the points in x. The dataframe will have the same index as the Series.

Examples

../../_images/staircase-core-arrays-accessor-StairsAccessor-sample-1.png
>>> import staircase as sc
>>> stairs = pd.Series([s2, s3], dtype="Stairs")
>>> [s2.closed, s3.closed]
["left", "left]
>>> stairs.sc.sample([2,3,4]))
     2    3    4
0  0.0 -1.0 -1.0
1  0.0  NaN -1.0