老规矩:题目来自群友求助
输出
import pandas as pd import os path="./Unmerge/" outfile='result.xlsx' pd.concat([ pd.read_excel(xlsxi, sheet_name=sheet_name) for xlsxi in [path + x for x in os.listdir(path) if x.endswith(".xlsx")] for sheet_name in list(pd.read_excel(xlsxi, sheet_name=None)) ] , ignore_index=True).to_excel(outfile,index=None)
看了下,96ms
executed in 96ms, finished 11:46:44 2021-10-23
其他群友答案: