Skip to main content

interval_range

Function interval_range 

Source
pub fn interval_range(
    start: Option<f64>,
    end: Option<f64>,
    periods: Option<usize>,
    freq: Option<f64>,
    closed: Option<IntervalClosed>,
) -> Result<Vec<Interval>, TypeError>
Expand description

Build equal-width intervals spanning a range, matching pd.interval_range.

Of the four parameters start, end, periods, and freq, exactly three must be specified (Some). closed defaults to IntervalClosed::Right when None.

§Errors

Returns TypeError::IntervalRangeParameterCount if not exactly 3 of the 4 parameters are specified. Returns TypeError::InvalidIntervalStep if freq is not finite, not positive, or zero. Returns TypeError::IntervalStepDoesNotDivide if start, end, and freq are given but (end - start) is not an integer multiple of freq.