批量合并多个表格方法
1、案例一
os.chdir('./path/')
total_data = pd.DataFrame()
for name in os.listdir():
# 合并多个csv文件
data = pd.read_csv(name)
total_data = pd.contact([total_data,data])
2、案例二
data_list = []
for name in os.listdir("."):
if name.startswith("产品") and name.endswith(".xlsx"):
data_list.append(pd.read_excel(name))
data_all = pd.concat(data_list)