.at and .iat indexing with Float64Index · Issue #8092 · pandas-dev/pandas (original) (raw)
Using .at and .iat indexing with a Float64Index produces an error:
In [0]: import pandas as pd In [1]: s = pd.Series([1,2,3], index = [0.1,0.2,0.3]) In [2]: s.at[0.1]
AttributeError Traceback (most recent call last) in () ----> 1 s.at[0.1]
/ifs/apps/apps/python-2.7.1/lib/python2.7/site-packages/pandas/core/indexing.pyc in getitem(self, key) 1264 1265 key = self._convert_key(key) -> 1266 return self.obj.get_value(*key) 1267 1268 def setitem(self, key, value):
/ifs/apps/apps/python-2.7.1/lib/python2.7/site-packages/pandas/core/series.pyc in get_value(self, label) 778 value : scalar value 779 """ --> 780 return self.index.get_value(self.values, label) 781 782 def set_value(self, label, value):
/ifs/apps/apps/python-2.7.1/lib/python2.7/site-packages/pandas/core/index.pyc in get_value(self, series, key) 1821 k = _values_from_object(key) 1822 loc = self.get_loc(k) -> 1823 new_values = series.values[loc] 1824 if np.isscalar(new_values): 1825 return new_values
AttributeError: 'numpy.ndarray' object has no attribute 'values'
In [3]: s.iat[1]
AttributeError Traceback (most recent call last) in () ----> 1 s.iat[1]
/ifs/apps/apps/python-2.7.1/lib/python2.7/site-packages/pandas/core/indexing.pyc in getitem(self, key) 1264 1265 key = self._convert_key(key) -> 1266 return self.obj.get_value(*key) 1267 1268 def setitem(self, key, value):
/ifs/apps/apps/python-2.7.1/lib/python2.7/site-packages/pandas/core/series.pyc in get_value(self, label) 778 value : scalar value 779 """ --> 780 return self.index.get_value(self.values, label) 781 782 def set_value(self, label, value):
/ifs/apps/apps/python-2.7.1/lib/python2.7/site-packages/pandas/core/index.pyc in get_value(self, series, key) 1821 k = _values_from_object(key) 1822 loc = self.get_loc(k) -> 1823 new_values = series.values[loc] 1824 if np.isscalar(new_values): 1825 return new_values
AttributeError: 'numpy.ndarray' object has no attribute 'values'
I'm not sure if this is intended behavoir. The docs only talk about [], loc, iloc and ix indexing with Float64Index, but if so, perhaps a more useful error message would be in order. I wasn't even aware my index was Float64. Its gotten changed at some point without me being aware of it.