将xlsx电子表格中所有sheet合并在一起

import pandas as pd

打开xlsx文件

xlsx = pd.ExcelFile('path_to_your_file.xlsx')

读取所有sheets到一个list中

sheets = \[\]

for sheet in xlsx.sheet_names:

sheets.append(xlsx.parse(sheet))

合并所有sheets

combined = pd.concat(sheets)

将合并后的数据写入新的Excel文件

combined.to_excel('combined_sheets.xlsx', index=False)

相关推荐
进击切图仔33 分钟前
在 windows 和 ubuntu 中配置 host 文件
linux·windows·ubuntu
烟锁池塘柳01 小时前
【亲测有效】Windows上更新NVIDIA显卡驱动的方法
windows·nvidia·显卡驱动
看浪的路人3 小时前
第5讲:代码审查与 Bug 检测
开发语言·windows·python
molaoye4 小时前
Windows修改系统环境变量不需要重启电脑之骚操作
windows
wling030114 小时前
vasp虚频计算-python脚本
开发语言·windows·python·vasp计算
在世修行20 小时前
Windows 上 Docker Desktop 部署 MySQL + TDengine 全过程(含 WSL 报错与镜像加速排障实战)
windows·mysql·docker·tdengine
Richard.Wong1 天前
Windows IIS 服务器部署 Vue3 前端项目详细流程
服务器·前端·windows
wyg_0311131 天前
Intel Arc 140T + Triton(Windows)环境搭建全过程记录
windows
程序猿小玉兒1 天前
Quartz定时任务偶尔不执行
服务器·windows·microsoft
曹牧2 天前
C#:`JsonConvert.DeserializeObject`
windows·c#