用pandas将多个excel文件合并成一个大表
作者:互联网
1 import os 2 import pandas as pd 3 path = r'C:\Users\Administrator\Desktop\合并' 4 df_list =[] 5 for filename in os.listdir(path): 6 if filename[0] == '~': 7 continue 8 a = os.path.join(path, filename) 9 df = pd.read_csv(a) 10 df_list.append(df) 11 ans = pd.concat(df_list) 12 ans.to_excel("全部债券.xlsx")
标签:df,excel,list,filename,pd,path,os,pandas,大表 来源: https://www.cnblogs.com/fangziyuan/p/15981271.html