class pandas.arrays.IntervalArray
[source]
Pandas array for interval data that are closed on the same side.
New in version 0.24.0.
Parameters: |
|
---|
See also
Index
Interval
interval_range
cut
qcut
See the user guide for more.
A new IntervalArray
can be constructed directly from an array-like of Interval
objects:
>>> pd.arrays.IntervalArray([pd.Interval(0, 1), pd.Interval(1, 5)]) IntervalArray([(0, 1], (1, 5]], closed='right', dtype='interval[int64]')
It may also be constructed using one of the constructor methods: IntervalArray.from_arrays()
, IntervalArray.from_breaks()
, and IntervalArray.from_tuples()
.
left | Return the left endpoints of each Interval in the IntervalArray as an Index |
right | Return the right endpoints of each Interval in the IntervalArray as an Index |
closed | Whether the intervals are closed on the left-side, right-side, both or neither |
mid | Return the midpoint of each Interval in the IntervalArray as an Index |
length | Return an Index with entries denoting the length of each Interval in the IntervalArray |
is_empty | Indicates if an interval is empty, meaning it contains no points. |
is_non_overlapping_monotonic | Return True if the IntervalArray is non-overlapping (no Intervals share points) and is either monotonic increasing or monotonic decreasing, else False |
from_arrays (left, right[, closed, copy, dtype]) | Construct from two arrays defining the left and right bounds. |
from_tuples (data[, closed, copy, dtype]) | Construct an IntervalArray from an array-like of tuples |
from_breaks (breaks[, closed, copy, dtype]) | Construct an IntervalArray from an array of splits. |
contains (self, other) | Check elementwise if the Intervals contain the value. |
overlaps (self, other) | Check elementwise if an Interval overlaps the values in the IntervalArray. |
set_closed (self, closed) | Return an IntervalArray identical to the current one, but closed on the specified side |
to_tuples (self[, na_tuple]) | Return an ndarray of tuples of the form (left, right) |
© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.arrays.IntervalArray.html