Skip to content

Commit 91088c2

Browse files
committed
put median tests together
1 parent a124390 commit 91088c2

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

pandas/tests/frame/test_analytics.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,17 @@ def wrapper(x):
817817
assert_stat_op_calc('median', wrapper, float_frame_with_na,
818818
check_dates=True)
819819

820+
# TODO: Ensure warning isn't emitted in the first place
821+
@pytest.mark.filterwarnings("ignore:All-NaN:RuntimeWarning")
822+
def test_median_corner(self, int_frame):
823+
def wrapper(x):
824+
if isna(x).any():
825+
return np.nan
826+
return np.median(x)
827+
828+
assert_stat_op_calc('median', wrapper, int_frame, check_dtype=False,
829+
check_dates=True)
830+
820831
def test_min(self, float_frame_with_na, int_frame):
821832
with warnings.catch_warnings(record=True):
822833
warnings.simplefilter("ignore", RuntimeWarning)
@@ -1184,17 +1195,6 @@ def test_stats_mixed_type(self, float_string_frame):
11841195
float_string_frame.mean(1)
11851196
float_string_frame.skew(1)
11861197

1187-
# TODO: Ensure warning isn't emitted in the first place
1188-
@pytest.mark.filterwarnings("ignore:All-NaN:RuntimeWarning")
1189-
def test_median_corner(self, int_frame, float_frame):
1190-
def wrapper(x):
1191-
if isna(x).any():
1192-
return np.nan
1193-
return np.median(x)
1194-
1195-
assert_stat_op_calc('median', wrapper, int_frame, check_dtype=False,
1196-
check_dates=True)
1197-
11981198
def test_sum_bools(self):
11991199
df = DataFrame(index=lrange(1), columns=lrange(10))
12001200
bools = isna(df)

0 commit comments

Comments
 (0)