pandas 1.4.2

AttributesMethodsNotesParameters

Attributes

left :
right :
closed :
mid :
length :
is_empty :
is_non_overlapping_monotonic :
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 IntervalArray.

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.

verify_integrity : bool, default True

Verify that the IntervalArray is valid.

Pandas array for interval data 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 IntervalArray.

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 IntervalArray can be constructed directly from an array-like of Interval objects:

This example is valid syntax, but we were not able to check execution
>>> pd.arrays.IntervalArray([pd.Interval(0, 1), pd.Interval(1, 5)])
<IntervalArray>
[(0, 1], (1, 5]]
Length: 2, dtype: interval[int64, right]

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

See :

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/arrays/interval.py#171
type: <class 'type'>
Commit: