#NEWLINE# def buildTrainingMatrixFromPredictions( fullSet , outputPath , predictorPaths , grabCSVColumnFunc , masterColumn ) : #NEWLINE# #INDENT# predictionArrays = [ grabCSVColumnFunc ( fullSet , predictPath ) ] #NEWLINE# for predictPath in predictorPaths : #NEWLINE# #INDENT# predictionArrays . append ( grabCSVColumnFunc ( predictPath , 2 ) ) #NEWLINE# #UNINDENT# toWrite = [ ] #NEWLINE# for i in range ( 0 , len ( predictionArrays [ 0 ] ) ) : #NEWLINE# #INDENT# rowStr = predictionArrays [ 0 ] [ i ] #NEWLINE# for j in range ( 1 , len ( predictionArrays ) ) : #NEWLINE# #INDENT# rowStr = ( ( rowStr + '\t' ) + predictionArrays [ j ] [ i ] ) #NEWLINE# #UNINDENT# rowStr = ( rowStr + '\n' ) #NEWLINE# toWrite . append ( rowStr ) #NEWLINE# #UNINDENT# outfile = open ( outputPath , 'w' ) #NEWLINE# outfile . writelines ( [ ( '%s' % row ) for row in toWrite ] )