pandas.IntervalIndex.close #

间隔索引。已关闭[来源] #

描述间隔包含端的字符串。

两者leftright一。bothneither

例子

对于数组:

>>> interv_arr = pd.arrays.IntervalArray([pd.Interval(0, 1), pd.Interval(1, 5)])
>>> interv_arr
<IntervalArray>
[(0, 1], (1, 5]]
Length: 2, dtype: interval[int64, right]
>>> interv_arr.closed
'right'

对于区间索引:

>>> interv_idx = pd.interval_range(start=0, end=2)
>>> interv_idx
IntervalIndex([(0, 1], (1, 2]], dtype='interval[int64, right]')
>>> interv_idx.closed
'right'