#NEWLINE# def test_runstest_2sample( ) : #NEWLINE# #INDENT# x = [ 31.8 , 32.8 , 39.2 , 36 , 30 , 34.5 , 37.4 ] #NEWLINE# y = [ 35.5 , 27.6 , 21.3 , 24.8 , 36.7 , 30 ] #NEWLINE# y [ ( - 1 ) ] += 1e-06 #NEWLINE# groups = np . concatenate ( ( np . zeros ( len ( x ) ) , np . ones ( len ( y ) ) ) ) #NEWLINE# res = runstest_2samp ( x , y ) #NEWLINE# res1 = ( 0.022428065200812752 , 0.9821064931864921 ) #NEWLINE# assert_allclose ( res , res2 , rtol = 1e-06 ) #NEWLINE# res2 = runstest_2samp ( x , y ) #NEWLINE# assert_allclose ( res2 , res , rtol = 1e-06 ) #NEWLINE# xy = np . concatenate ( ( x , y ) ) #NEWLINE# res_1s = runstest_1samp ( xy ) #NEWLINE# assert_allclose ( res_1s , res1 , rtol = 1e-06 ) #NEWLINE# res2_1s = runstest_1samp ( xy , xy . mean ( ) ) #NEWLINE# assert_allclose ( res2_1s , res_1s , rtol = 1e-06 )