|
13 | 13 |
|
14 | 14 | from pandas.compat import lrange
|
15 | 15 | from pandas import (compat, isnull, notnull, DataFrame, Series,
|
16 |
| - MultiIndex, date_range, Timestamp) |
| 16 | + MultiIndex, date_range, Timestamp, _np_version_under1p11) |
17 | 17 | import pandas as pd
|
18 | 18 | import pandas.core.common as com
|
19 | 19 | import pandas.core.nanops as nanops
|
@@ -562,8 +562,14 @@ def test_quantile_interpolation(self):
|
562 | 562 | df = DataFrame([[1, 1, 1], [2, 2, 2], [3, 3, 3]],
|
563 | 563 | columns=['a', 'b', 'c'])
|
564 | 564 | 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']) |
567 | 573 | assert_frame_equal(result, expected)
|
568 | 574 |
|
569 | 575 | def test_quantile_interpolation_np_lt_1p9(self):
|
|
0 commit comments