file_name = r'D:\ParttimeJobs\MinistConfiguration\datas\mnist_train.csv' # 数据集为42000张带标签的28x28手写数字图像y = []x = []y_t = []x_t = []with open(file_name, 'r') as f:reader = csv.reader(f)header_row = next(reader)# print(header_row)for row in reader:if np.random.random() < 0.8: # 大约80%的数据用于训练y.append(int(row[0]))x.append(list(map(, row[1:])))else:y_t.append(int(row[0]))x_t.append(list(map(, row[1:])))