#NEWLINE# def test_splitting( ) : #NEWLINE# #INDENT# signal_df = pandas . DataFrame ( numpy . ones ( [ 10 , 10 ] ) ) #NEWLINE# bg_df = pandas . DataFrame ( numpy . zeros ( [ 10 , 10 ] ) ) #NEWLINE# common_X = pandas . concat ( [ signal_df , bg_df ] , ignore_index = True ) #NEWLINE# common_y = numpy . concatenate ( [ numpy . ones ( len ( signal_df ) ) , numpy . zeros ( len ( bg_df ) ) ] ) #NEWLINE# ( trainX , testX , trainY , testY ) = commonutils . train_test_split ( common_X , common_y ) #NEWLINE# for ( ( index , row ) , label ) in zip ( trainX . iterrows ( ) , trainY ) : #NEWLINE# #INDENT# assert numpy . all ( ( row == label ) ) , 'wrong data partition' #NEWLINE# #UNINDENT# for ( ( index , row ) , label ) in zip ( testX . iterrows ( ) , testY ) : #NEWLINE# #INDENT# assert numpy . all ( ( row == label ) ) , 'wrong data partition'