pandas.IntervalIndex.from_arrays

pandas 3.1.1 · Index objects · 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

IntervalIndex.from_arrays(left, right, closed='right', name=None, copy=False, dtype=None)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted 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.

name Optional
Positional or keyword
Default None
str

Set a name or identify the named object used by the operation.

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

IntervalIndex