#導(dǎo)入要用的包
import pandas as pd
import numpy as np
import os, shutil
#開始合并
excel_path =r"E:\data"? ? ?#文件夾路徑
excel_name = r"銷售明細(xì).xlsx"? ? ? #Excel名
excel_cols = ['姓名', '人數(shù)', '銷量', '單價(jià)', '總銷售額']? ? ? ? ?#每個(gè)sheet的表頭
excel_file_name = os.path.join(agent_path, agent_name)
excel_file = pd.ExcelFile(agetn_file_name)
pd.concat([pd.read_excel(excel_file,
? ? ? ? ? ? ? ? ? ? ? ? sheet_name= name,
? ? ? ? ? ? ? ? ? ? ? ? names= agent_cols)
? ? ? ? ? for name in excel_file.sheet_names],
? ? ? ? ? ignore_index= True).to_csv(excel_path+ r'\excel_combine.csv', index = False, encoding = 'gbk')