Python合并多Excel文件
具体方法
下载安装好pandas并import pandas as pd
代码如下
import pandas as pd
file1='C:/e1.xlsx'
file2='C:/e2.xlsx'
file3='C:/e3.xlsx'
file=[file1,file2,file3]
li=[]
for i in file:
li.append(pd.read_excel(i))
writer = pd.ExcelWriter('C:/output.xlsx')
pd.concat(li).to_excel(writer,'Sheet1',index=False)
writer.save()