pandas.arrays.IntervalArray.from_arrays
pandas 3.1.1 · Arrays, scalars, and data types · method
Build an object from parallel arrays. For a MultiIndex each array supplies a level. For interval data the arrays supply left and right edges.
Call syntax
IntervalArray.from_arrays(left, right, 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 |
|---|---|---|
left |
Required Positional or keyword |
array-like (1-dimensional) Supply the left-hand input or the left endpoint of the interval. |
right |
Required Positional or keyword |
array-like (1-dimensional) Supply the right-hand input or the right endpoint of the interval. |
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 Choose the data type for the input conversion or result. |
Returns
IntervalArray