cudf.interval_range#

cudf.interval_range(start=None, end=None, periods=None, freq=None, name=None, closed='right') IntervalIndex[source]#

Returns a fixed frequency IntervalIndex.

Parameters:
startnumeric, default None

Left bound for generating intervals.

endnumeric , default None

Right bound for generating intervals.

periodsint, default None

Number of periods to generate

freqnumeric, default None

The length of each interval. Must be consistent with the type of start and end

namestr, default None

Name of the resulting IntervalIndex.

closed{“left”, “right”, “both”, “neither”}, default “right”

Whether the intervals are closed on the left-side, right-side, both or neither.

Returns:
IntervalIndex

Examples

>>> import cudf
>>> import pandas as pd
>>> cudf.interval_range(start=0,end=5)
IntervalIndex([(0, 0], (1, 1], (2, 2], (3, 3], (4, 4], (5, 5]],
...closed='right',dtype='interval')
>>> cudf.interval_range(start=0,end=10, freq=2,closed='left')
IntervalIndex([[0, 2), [2, 4), [4, 6), [6, 8), [8, 10)],
...closed='left',dtype='interval')
>>> cudf.interval_range(start=0,end=10, periods=3,closed='left')
...IntervalIndex([[0.0, 3.3333333333333335),
        [3.3333333333333335, 6.666666666666667),
        [6.666666666666667, 10.0)],
        closed='left',
        dtype='interval')