将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)

相关推荐
2501_941982058 小时前
企业微信二次开发:私域数据基石——三大核心基础能力接口实战
windows·架构·bootstrap·企业微信
美丽的欣情18 小时前
RK3588 Debian 交叉编译环境搭建(Windows + VMware Debian + CMake)
运维·windows·debian
勤劳打代码18 小时前
Flutter 架构指南 —— windows 平台安装拆解
windows·架构
aramae1 天前
C++11:现代C++的里程碑
c语言·开发语言·c++·windows·git·后端
执行x1 天前
wsl2安装+桥接模式+固定IP
linux·windows·ubuntu
做萤石二次开发的哈哈1 天前
如何接入萤石开放平台 ERTC Windows SDK?
windows·音视频·萤石开放平台
橙臣程1 天前
在 Windows 中使用 WSL2 搭建 Ubuntu 开发环境
linux·windows·ubuntu
霸道流氓气质1 天前
Windows 本地搭建 CDC 全链路测试环境(Kafka+Canel+binlog+SpringBoot)
windows·spring boot·kafka
郝开1 天前
Windows 安装 Ostris AI Toolkit
人工智能·windows·toolkit·ai toolkit
疯狂成瘾者2 天前
Java 常见集合方法
java·windows·python