Skip to content

Commit 6f9b2eb

Browse files
committed
Remove redundant test. Place interpolation in single quotes
1 parent 012fda7 commit 6f9b2eb

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

pandas/_libs/window.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ def roll_quantile(ndarray[float64_t, cast=True] input, int64_t win,
13981398
try:
13991399
interpolation_type = interpolation_types[interpolation]
14001400
except KeyError:
1401-
raise ValueError("Interpolation {} is not supported"
1401+
raise ValueError("Interpolation '{}' is not supported"
14021402
.format(interpolation))
14031403

14041404
# we use the Fixed/Variable Indexer here as the

pandas/tests/test_window.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,16 +1129,6 @@ def test_rolling_quantile_np_percentile(self):
11291129

11301130
tm.assert_almost_equal(df_quantile.values, np.array(np_percentile))
11311131

1132-
def test_rolling_quantile_series(self):
1133-
# #16211: Tests that rolling window's quantile default behavior
1134-
# is analogous to Series' quantile
1135-
arr = np.arange(100)
1136-
s = Series(arr)
1137-
q1 = s.quantile(0.1)
1138-
q2 = s.rolling(100).quantile(0.1).iloc[-1]
1139-
1140-
tm.assert_almost_equal(q1, q2)
1141-
11421132
@pytest.mark.skipif(_np_version_under1p12,
11431133
reason='numpy midpoint interpolation is broken')
11441134
@pytest.mark.parametrize('quantile', [0.0, 0.1, 0.45, 0.5, 1])
@@ -1149,7 +1139,7 @@ def test_rolling_quantile_series(self):
11491139
[0., np.nan, 0.2, np.nan, 0.4],
11501140
[np.nan, np.nan, np.nan, np.nan],
11511141
[np.nan, 0.1, np.nan, 0.3, 0.4, 0.5],
1152-
[0.5], [np.nan, 0.7, 0.5]])
1142+
[0.5], [np.nan, 0.7, 0.6]])
11531143
def test_rolling_quantile_interpolation_options(self, quantile,
11541144
interpolation, data):
11551145
# Tests that rolling window's quantile behavior is analogous to
@@ -1163,13 +1153,13 @@ def test_rolling_quantile_interpolation_options(self, quantile,
11631153
if np.isnan(q1):
11641154
assert np.isnan(q2)
11651155
else:
1166-
assert round(q1, 15) == round(q2, 15)
1156+
assert q1 == q2
11671157

11681158
def test_invalid_quantile_value(self):
11691159
data = np.arange(5)
11701160
s = Series(data)
11711161

1172-
with pytest.raises(ValueError, match="Interpolation invalid"
1162+
with pytest.raises(ValueError, match="Interpolation 'invalid'"
11731163
" is not supported"):
11741164
s.rolling(len(data), min_periods=1).quantile(
11751165
0.5, interpolation='invalid')

0 commit comments

Comments
 (0)