pandas 1.4.2

ParametersReturnsBackRef
overlaps(self, other)

Two intervals overlap if they share a common point, including closed endpoints. Intervals that only have an open endpoint in common do not overlap.

Parameters

other : IntervalArray

Interval to check against for an overlap.

Returns

ndarray

Boolean array positionally indicating where an overlap occurs.

Check elementwise if an Interval overlaps the values in the IntervalArray.

See Also

Interval.overlaps

Check whether two Interval objects overlap.

Examples

This example is valid syntax, but we were not able to check execution
>>> data = [(0, 1), (1, 3), (2, 4)]
... intervals = pd.arrays.IntervalArray.from_tuples(data)
... intervals <IntervalArray> [(0, 1], (1, 3], (2, 4]] Length: 3, dtype: interval[int64, right]
This example is valid syntax, but we were not able to check execution
>>> intervals.overlaps(pd.Interval(0.5, 1.5))
array([ True,  True, False])

Intervals that share closed endpoints overlap:

This example is valid syntax, but we were not able to check execution
>>> intervals.overlaps(pd.Interval(1, 3, closed='left'))
array([ True,  True, True])

Intervals that only have an open endpoint in common do not overlap:

This example is valid syntax, but we were not able to check execution
>>> intervals.overlaps(pd.Interval(1, 2, closed='right'))
array([False,  True, False])
See :

Back References

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

pandas.core.arrays.interval.IntervalArray.contains

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#1293
type: <class 'function'>
Commit: