Closed
Description
Follow-up on #27926 and #27865
DataFrame._get_value
with an IntervalIndex is not working properly:
In [24]: df = DataFrame(
...: np.random.randn(5, 2),
...: columns=["a", "b"],
...: index=pd.IntervalIndex.from_breaks([-np.inf, 0, 1, 2, 3, np.inf]),
...: )
In [26]: df._get_value(df.index[0], 'a')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-26-ce242a095ada> in <module>
----> 1 df._get_value(df.index[0], 'a')
~/scipy/pandas/pandas/core/frame.py in _get_value(self, index, col, takeable)
2953
2954 try:
-> 2955 return engine.get_value(series._values, index)
2956 except KeyError:
2957 # GH 20629
AttributeError: 'pandas._libs.interval.IntervalTree' object has no attribute 'get_value'
This _get_value
is used in ix
which is deprecated, but also in at
which is not deprecated:
In [27]: df.at[df.index[0], 'a']
...
AttributeError: 'pandas._libs.interval.IntervalTree' object has no attribute 'get_value'