4
4
import numpy as np
5
5
import pytest
6
6
7
- from pandas .compat import PY37 , is_platform_windows
7
+ from pandas .compat import PY37
8
8
9
9
import pandas as pd
10
10
from pandas import (
@@ -209,10 +209,9 @@ def test_level_get_group(observed):
209
209
assert_frame_equal (result , expected )
210
210
211
211
212
- # GH#21636 previously flaky on py37
213
- @pytest .mark .xfail (
214
- is_platform_windows () and PY37 , reason = "Flaky, GH-27902" , strict = False
215
- )
212
+ # GH#21636 flaky on py37; may be related to older numpy, see discussion
213
+ # https://github.com/MacPython/pandas-wheels/pull/64
214
+ @pytest .mark .xfail (PY37 , reason = "Flaky, GH-27902" , strict = False )
216
215
@pytest .mark .parametrize ("ordered" , [True , False ])
217
216
def test_apply (ordered ):
218
217
# GH 10138
@@ -229,6 +228,9 @@ def test_apply(ordered):
229
228
idx = MultiIndex .from_arrays ([missing , dense ], names = ["missing" , "dense" ])
230
229
expected = DataFrame ([0 , 1 , 2.0 ], index = idx , columns = ["values" ])
231
230
231
+ # GH#21636 tracking down the xfail, in some builds np.mean(df.loc[[0]])
232
+ # is coming back as Series([0., 1., 0.], index=["missing", "dense", "values"])
233
+ # when we expect Series(0., index=["values"])
232
234
result = grouped .apply (lambda x : np .mean (x ))
233
235
assert_frame_equal (result , expected )
234
236
0 commit comments