Skip to content

Commit f683dc7

Browse files
committed
TST: work around numpy numpy/numpy#7163
closes #12196 xref numpy/numpy#7163 Author: Jeff Reback <[email protected]> Closes #12197 from jreback/numpy_fix2 and squashes the following commits: 34632a4 [Jeff Reback] TST: work around numpy numpy/numpy#7163 xref #12196
1 parent 34d9839 commit f683dc7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pandas/tests/frame/test_analytics.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from pandas.compat import lrange
1515
from pandas import (compat, isnull, notnull, DataFrame, Series,
16-
MultiIndex, date_range, Timestamp)
16+
MultiIndex, date_range, Timestamp, _np_version_under1p11)
1717
import pandas as pd
1818
import pandas.core.common as com
1919
import pandas.core.nanops as nanops
@@ -562,8 +562,14 @@ def test_quantile_interpolation(self):
562562
df = DataFrame([[1, 1, 1], [2, 2, 2], [3, 3, 3]],
563563
columns=['a', 'b', 'c'])
564564
result = df.quantile([.25, .5], interpolation='midpoint')
565-
expected = DataFrame([[1.5, 1.5, 1.5], [2.5, 2.5, 2.5]],
566-
index=[.25, .5], columns=['a', 'b', 'c'])
565+
566+
# https://github.com/numpy/numpy/issues/7163
567+
if _np_version_under1p11:
568+
expected = DataFrame([[1.5, 1.5, 1.5], [2.5, 2.5, 2.5]],
569+
index=[.25, .5], columns=['a', 'b', 'c'])
570+
else:
571+
expected = DataFrame([[1.5, 1.5, 1.5], [2.0, 2.0, 2.0]],
572+
index=[.25, .5], columns=['a', 'b', 'c'])
567573
assert_frame_equal(result, expected)
568574

569575
def test_quantile_interpolation_np_lt_1p9(self):

0 commit comments

Comments
 (0)