staircase.Stairs.fractile#
- property Stairs.fractile#
This property returns a
staircase.Fractiles
object.Fractiles is a subclass of Stairs. Although it inherits all methods of Stairs, it is expected that it will typically only be used as a callable class, to calculate the x fractile with the following parameters.
- Parameters
- xfloat or array-like of float
Percentile or sequence of fractiles to compute,. Must be between 0 and 1.
- Returns
- float or
numpy.ndarray
of floats
- float or
See also
Examples
>>> sf = sc.Stairs().layer([0,1,2,3,4], [6,7,8,9,10]) >>> fig, axes = plt.subplots(ncols=2, figsize=(7,3), sharey=True) >>> sf.plot(axes[0]) >>> axes[0].set_title("sf") >>> sf.fractile.plot(axes[1]) >>> axes[1].set_title("fractile function")
>>> sf.fractile <staircase.Fractiles, id=2151414503360>
>>> sf.fractile(0.5) 3
>>> sf.percentile([0.25, 0.5, 0.75]) array([2., 3., 4.])