pandas.IntervalIndex.from_tuples
pandas 3.1.1 · Index objects · method
Construct an index or interval array from tuples. An interval tuple supplies its two endpoints.
Call syntax
IntervalIndex.from_tuples(data, closed='right', name=None, 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 |
|---|---|---|
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. |
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 or None Choose the data type for the input conversion or result. |
Returns
IntervalIndex