from sklearn.model_selection import train_test_split
import pandas as pd
myset = pd.read_csv("data.txt", header = None) #header = None将列名设置为空
train_data,test_data = train_test_split(myset,test_size = 0.5)
print(train_data)
train_data.to_csv('123.txt') #写进123.txt