# 将不同文件下的多个csv按顺序合并在一起
for file in os.listdir(r"/media/shuaishuai/JSY/实验数据备份/snippets/feature"):
for filepath,dirnames,filenames in os.walk(r'/media/shuaishuai/JSY/实验数据备份/snippets/feature/'+file):
dirnames.sort()
for filename in filenames:
path = os.path.join(filepath+'/'+filename)
fl = pd.read_csv(path, header = None)
fl.to_csv("/media/shuaishuai/JSY/实验数据备份/snippets/total_feature/"+file+".csv", mode='a', index=False, header=False)
# 将不同文件夹下的CSV文件合并在不同文件夹下
来源:CSDN
作者:bulingbuling的小狮子
链接:https://blog.csdn.net/lord0555/article/details/103745315