pandas合併excel文件

 

如今有多個excel 文件,須要對其進行合併python

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()
相關文章
相關標籤/搜索