From 7cb9883d9c7bbb7f2a3e8994f25a5f2ae7b36997 Mon Sep 17 00:00:00 2001 From: makbigc Date: Mon, 3 Jun 2019 22:35:27 +0800 Subject: [PATCH 1/2] Remove duplicate code --- pandas/tests/frame/test_quantile.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pandas/tests/frame/test_quantile.py b/pandas/tests/frame/test_quantile.py index 9ccbd290923ba..7fc85ef989bb1 100644 --- a/pandas/tests/frame/test_quantile.py +++ b/pandas/tests/frame/test_quantile.py @@ -159,12 +159,6 @@ def test_quantile_interpolation_int(self, int_frame): q = df.quantile(0.1) assert q['A'] == np.percentile(df['A'], 10) - # test with and without interpolation keyword - # TODO: q1 is not different from q - q1 = df.quantile(0.1) - assert q1['A'] == np.percentile(df['A'], 10) - tm.assert_series_equal(q, q1) - def test_quantile_multi(self): df = DataFrame([[1, 1, 1], [2, 2, 2], [3, 3, 3]], columns=['a', 'b', 'c']) From 715f4ae7db071a39c3f3616b1da78a23c3dc16b2 Mon Sep 17 00:00:00 2001 From: makbigc Date: Tue, 4 Jun 2019 18:33:01 +0800 Subject: [PATCH 2/2] Undo the deletion and add linear interpolation to q1 --- pandas/tests/frame/test_quantile.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandas/tests/frame/test_quantile.py b/pandas/tests/frame/test_quantile.py index 7fc85ef989bb1..097477c42d249 100644 --- a/pandas/tests/frame/test_quantile.py +++ b/pandas/tests/frame/test_quantile.py @@ -159,6 +159,11 @@ def test_quantile_interpolation_int(self, int_frame): q = df.quantile(0.1) assert q['A'] == np.percentile(df['A'], 10) + # test with and without interpolation keyword + q1 = df.quantile(0.1, axis=0, interpolation='linear') + assert q1['A'] == np.percentile(df['A'], 10) + tm.assert_series_equal(q, q1) + def test_quantile_multi(self): df = DataFrame([[1, 1, 1], [2, 2, 2], [3, 3, 3]], columns=['a', 'b', 'c'])