Skip to content

Commit efbba10

Browse files
committed
fix: Fixes wrong test case assumption when using linear interpolation on series with datetime index using business days only (test case pandas.tests.series.methods.test_interpolate.TestSeriesInterpolateData.test_interpolate).
1 parent a04a3a2 commit efbba10

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: pandas/tests/series/methods/test_interpolate.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ def test_interpolate(self, datetime_series):
9494
ts = Series(np.arange(len(datetime_series), dtype=float), datetime_series.index)
9595

9696
ts_copy = ts.copy()
97-
ts_copy[5:10] = np.nan
97+
98+
# Set data between Tuesday and Thursday to NaN for 2 consecutive weeks.
99+
# Linear interpolation should fill in the missing values correctly,
100+
# as the index is equally-spaced within each week.
101+
ts_copy[1:4] = np.nan
102+
ts_copy[6:9] = np.nan
98103

99104
linear_interp = ts_copy.interpolate(method="linear")
100105
tm.assert_series_equal(linear_interp, ts)

0 commit comments

Comments
 (0)