@@ -817,6 +817,17 @@ def wrapper(x):
817
817
assert_stat_op_calc ('median' , wrapper , float_frame_with_na ,
818
818
check_dates = True )
819
819
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
+
820
831
def test_min (self , float_frame_with_na , int_frame ):
821
832
with warnings .catch_warnings (record = True ):
822
833
warnings .simplefilter ("ignore" , RuntimeWarning )
@@ -1184,17 +1195,6 @@ def test_stats_mixed_type(self, float_string_frame):
1184
1195
float_string_frame .mean (1 )
1185
1196
float_string_frame .skew (1 )
1186
1197
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
-
1198
1198
def test_sum_bools (self ):
1199
1199
df = DataFrame (index = lrange (1 ), columns = lrange (10 ))
1200
1200
bools = isna (df )
0 commit comments