Immutable index of intervals that are closed on the same side.
New in version 0.20.0.
Array-like containing Interval objects from which to build the
Whether the intervals are closed on the left-side, right-side, both or
If None, dtype will be inferred.
New in version 0.23.0.
Copy the input data.
Name to be stored in the index.
Verify that the IntervalIndex is valid.
The base pandas Index type.
A bounded slice-like interval; the elements of an IntervalIndex.
Function to create a fixed frequency IntervalIndex.
Bin values into discrete Intervals.
Bin values into equal-sized Intervals based on rank or sample quantiles.
See the user guide
A new IntervalIndex is typically constructed using
>>> pd.interval_range(start=0, end=5)
IntervalIndex([(0, 1], (1, 2], (2, 3], (3, 4], (4, 5]],
It may also be constructed using one of the constructor
IntervalIndex.from_breaks(), and IntervalIndex.from_tuples().
See further examples in the doc strings of interval_range and the
mentioned constructor methods.
Return the left endpoints of each Interval in the IntervalArray as an Index.
Return the right endpoints of each Interval in the IntervalArray as an Index.
Whether the intervals are closed on the left-side, right-side, both or neither.
Return the midpoint of each Interval in the IntervalArray as an Index.
Return an Index with entries denoting the length of each Interval in the IntervalArray.
Indicates if an interval is empty, meaning it contains no points.
Return True if the IntervalArray is non-overlapping (no Intervals share points) and is either monotonic increasing or monotonic decreasing, else False.
Return True if the IntervalIndex has overlapping intervals, else False.
Return the IntervalIndex’s data as an IntervalArray.
from_arrays(left, right, closed[, name, dtype])
Construct from two arrays defining the left and right bounds.
from_tuples(data, closed[, name, dtype])
Construct an IntervalIndex from an array-like of tuples.
from_breaks(breaks, closed[, name, dtype])
Construct an IntervalIndex from an array of splits.
contains(self, *args, **kwargs)
Check elementwise if the Intervals contain the value.
overlaps(self, *args, **kwargs)
Check elementwise if an Interval overlaps the values in the IntervalArray.
set_closed(self, *args, **kwargs)
Return an IntervalArray identical to the current one, but closed on the specified side.
to_tuples(self, *args, **kwargs)
Return an ndarray of tuples of the form (left, right).