Skip to content

Commit 86ecb99

Browse files
committed
Merge pull request #8094 from cpcloud/float64index-iat-at
BUG: fix iat and at for Float64Index
2 parents a72d951 + 0b3c53e commit 86ecb99

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

doc/source/v0.15.0.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ Bug Fixes
634634

635635

636636

637-
637+
- Bug in ``Float64Index`` where ``iat`` and ``at`` were not testing and were
638+
failing (:issue:`8092`).
638639

639640

640641

pandas/core/index.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2309,7 +2309,8 @@ def get_value(self, series, key):
23092309

23102310
k = _values_from_object(key)
23112311
loc = self.get_loc(k)
2312-
new_values = series.values[loc]
2312+
new_values = _values_from_object(series)[loc]
2313+
23132314
if np.isscalar(new_values) or new_values is None:
23142315
return new_values
23152316

pandas/tests/test_indexing.py

+7
Original file line numberDiff line numberDiff line change
@@ -3818,6 +3818,13 @@ def test_float_index_non_scalar_assignment(self):
38183818
df.loc[df.index] = df.loc[df.index]
38193819
tm.assert_frame_equal(df,df2)
38203820

3821+
def test_float_index_at_iat(self):
3822+
s = pd.Series([1, 2, 3], index=[0.1, 0.2, 0.3])
3823+
for el, item in s.iteritems():
3824+
self.assertEqual(s.at[el], item)
3825+
for i in range(len(s)):
3826+
self.assertEqual(s.iat[i], i + 1)
3827+
38213828

38223829
class TestSeriesNoneCoercion(tm.TestCase):
38233830
EXPECTED_RESULTS = [

0 commit comments

Comments
 (0)