pandas.arrays.IntervalArray.from_breaks
pandas 3.1.1 · Arrays, scalars, and data types · method
Construct adjacent intervals from a sequence of consecutive boundaries.
Call syntax
IntervalArray.from_breaks(breaks, closed='right', copy=False, dtype=None)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
breaks |
Required Positional or keyword |
array-like (1-dimensional) |
closed |
Optional Positional or keyword Default 'right' |
{'left', 'right', 'both', 'neither'} Choose which interval boundaries are included. |
copy |
Optional Positional or keyword Default False |
bool Control whether data is copied where the API supports that choice. |
dtype |
Optional Positional or keyword Default None |
dtype or None Choose the data type for the input conversion or result. |
Returns
IntervalArray