pandas.arrays.IntervalArray.to_tuples#

IntervalArray.to_tuples(na_tuple=True)[source]#

Return an ndarray of tuples of the form (left, right).

Parameters:
na_tuplebool, default True

Returns NA as a tuple if True, (nan, nan), or just as the NA value itself if False, nan.

Returns:
tuples: ndarray

Examples

>>> idx = pd.arrays.IntervalArray.from_tuples([(0, 1), (1, 2)])
>>> idx
<IntervalArray>
[(0, 1], (1, 2]]
Length: 2, dtype: interval[int64, right]
>>> idx.to_tuples()
array([(0, 1), (1, 2)], dtype=object)