pandas.arrays.IntervalArray.from_tuples

pandas 3.1.1 · Arrays, scalars, and data types · method

Construct an index or interval array from tuples. An interval tuple supplies its two endpoints.

Call syntax

IntervalArray.from_tuples(data, closed='right', copy=False, dtype=None)

Run the example

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

Parameters

ParameterRequirementAccepted values and behavior
data Required
Positional or keyword
array-like (1-dimensional)

Provide the input data read, transformed, or stored by this call.

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