def merge_data(): testData1, testClass1, trainData1, trainClass1 = creatData.readData('suicide.txt') testData2, testClass2, trainData2, trainClass2 = creatData.readData('non_suicide.txt') trainData1.extend(trainData2) trainClass1.extend(trainClass2) testData1.extend(testData2) testClass1.extend(testClass2) return testData1, testClass1, trainData1, trainClass1
import creatData testData, testClass, trainData, trainClass = creatData.readData('suicide.txt') for line in trainData: for i in line: print i