pandas合并excel文件

 

现在有多个excel 文件,需要对其进行合并

import pandas as pd

path=''

list1=[]  #save data
data=pd.read_excel(path,dtype=object)  #read excel
list1.append(data)
write = pd.ExcelWriter(path +'.xlsx')
pd.concat(list1).to_excel(write, 'sheet_name', index=False)  # merge data and save excel
write.save()

  

posted @ 2019-10-24 19:50  爱吃猫的鱼i  阅读(992)  评论(0编辑  收藏  举报