Skip to content

Commit abb8a45

Browse files
committed
fixup! fixup! REF: IntervalIndex[IntervalArray]
1 parent 9e5fc50 commit abb8a45

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pandas/core/arrays/interval.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,10 +704,6 @@ def size(self):
704704
def shape(self):
705705
return self.left.shape
706706

707-
@property
708-
def itemsize(self):
709-
return self.left.itemsize + self.right.itemsize
710-
711707
@property
712708
def is_non_overlapping_monotonic(self):
713709
"""

pandas/tests/extension/test_interval.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22
import numpy as np
33

4-
from pandas import Interval
4+
from pandas import Interval, IntervalIndex
55
from pandas.core.arrays import IntervalArray
66
from pandas.core.dtypes.dtypes import IntervalDtype
77
from pandas.tests.extension import base
@@ -118,5 +118,8 @@ class TestReshaping(BaseInterval, base.BaseReshapingTests):
118118
pass
119119

120120

121-
def test_repr():
122-
idx = pd.interval_range(0, 4)
121+
def test_repr_matches():
122+
idx = IntervalIndex.from_breaks([1, 2, 3])
123+
a = repr(idx)
124+
b = repr(idx.values)
125+
assert a.replace("Index", "Array") == b

0 commit comments

Comments
 (0)