Skip to content

Commit eaacefd

Browse files
committed
Added test which fails for method='pad'
For method='pad' the `max_gap` keyword does not seem to have an effect.
1 parent 1f0406f commit eaacefd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pandas/tests/series/test_missing.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,6 @@ def test_interp_max_gap(self):
12621262
5., np.nan, np.nan, np.nan,
12631263
-1., -1, -1
12641264
])
1265-
12661265
result = s.interpolate(method='linear', max_gap=2)
12671266
assert_series_equal(result, excpected)
12681267

@@ -1273,10 +1272,19 @@ def test_interp_max_gap(self):
12731272
5., np.nan, np.nan, np.nan,
12741273
-1., np.nan, np.nan
12751274
])
1276-
12771275
result = s.interpolate(method='linear', max_gap=2, limit_area='inside')
12781276
assert_series_equal(result, excpected)
12791277

1278+
excpected = Series([
1279+
np.nan,
1280+
1., 1,
1281+
2., 2., 2.,
1282+
5., np.nan, np.nan, np.nan,
1283+
-1., np.nan, np.nan
1284+
])
1285+
result = s.interpolate(method='pad', max_gap=2, limit_area='inside')
1286+
assert_series_equal(result, excpected)
1287+
12801288
def test_interp_max_gap_errors(self):
12811289
s = Series([
12821290
np.nan,

0 commit comments

Comments
 (0)