Skip to content

Commit 992e207

Browse files
committed
fix: Fixes wrong test case assumption for interpolation
Fixes assumption in `test_interp_basic_with_non_range_index`. If the index is [1, 2, 3, 5] and values are [1, 2, np.nan, 4], it is wrong to expect that interpolation will result in 3 for the missing value in case of linear interpolation. It will rather be 2.666...
1 parent 238205c commit 992e207

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/tests/frame/methods/test_interpolate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def test_interp_basic_with_non_range_index(self, using_infer_string):
127127
with tm.assert_produces_warning(warning, match=msg):
128128
result = df.set_index("C").interpolate()
129129
expected = df.set_index("C")
130-
expected.loc[3, "A"] = 3
130+
expected.loc[3, "A"] = 2.66667
131131
expected.loc[5, "B"] = 9
132132
tm.assert_frame_equal(result, expected)
133133

0 commit comments

Comments
 (0)