#coding=utf-8 import os import pandas as pd import glob
target_csv = '../data/train_data.csv'
defcombine(): csv_list = glob.glob('../data/pre_data/*.csv') print(u'共发现%s个CSV文件'% len(csv_list)) print(u'正在处理............') for i in csv_list: fr = open(i,'r').read() withopen(target_csv,'a') as f: f.write(fr) print(u'合并完毕!')