pandas 1.4.2

AttributesMethodsNotesParametersBackRef

Attributes

left :
right :
closed :
mid :
length :
is_empty :
is_non_overlapping_monotonic :
is_overlapping :
values :
versionadded

Methods

Notes

See the :None:None:`user guide <https://pandas.pydata.org/pandas-docs/stable/user_guide/advanced.html#intervalindex>` for more.

Parameters

data : array-like (1-dimensional)

Array-like containing Interval objects from which to build the IntervalIndex.

closed : {'left', 'right', 'both', 'neither'}, default 'right'

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

dtype : dtype or None, default None

If None, dtype will be inferred.

copy : bool, default False

Copy the input data.

name : object, optional

Name to be stored in the index.

verify_integrity : bool, default True

Verify that the IntervalIndex is valid.

Immutable index of intervals that are closed on the same side.

See Also

Index

The base pandas Index type.

Interval

A bounded slice-like interval; the elements of an IntervalIndex.

cut

Bin values into discrete Intervals.

interval_range

Function to create a fixed frequency IntervalIndex.

qcut

Bin values into equal-sized Intervals based on rank or sample quantiles.

Examples

A new IntervalIndex is typically constructed using interval_range :

This example is valid syntax, but we were not able to check execution
>>> pd.interval_range(start=0, end=5)
IntervalIndex([(0, 1], (1, 2], (2, 3], (3, 4], (4, 5]],
              dtype='interval[int64, right]')

It may also be constructed using one of the constructor methods: IntervalIndex.from_arrays , IntervalIndex.from_breaks , and IntervalIndex.from_tuples .

See further examples in the doc strings of interval_range and the mentioned constructor methods.

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.core.indexes.base.Index.is_interval pandas.core.reshape.tile.cut pandas._libs.interval.Interval pandas.core.indexes.base.Index pandas.core.indexes.interval.interval_range

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/indexes/interval.py#145
type: <class 'type'>
Commit: