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

相关推荐
funfan051739 分钟前
【开发AI】Windows安装和使用Milvus的保姆级教程
人工智能·windows·milvus
刚子编程1 小时前
ASP.NET Core Blazor简介和快速入门三(布局和路由)
windows
洛克大航海4 小时前
Windows 中启动 ms office 报错0xc0000142
windows·ms office·0xco0000142
sukalot6 小时前
windows显示驱动开发-缩放桌面图像(二)
windows·驱动开发
盒马盒马9 小时前
Rust:Windows 系统 VsCode 环境搭建
windows·vscode·rust
小龙报9 小时前
《数组和函数的实践游戏---扫雷游戏(基础版附源码)》
c语言·开发语言·windows·游戏·创业创新·学习方法·visual studio
读书读傻了哟11 小时前
Windows 10 下 VS Code 配置 C++ 开发环境(MinGW)
c++·windows·mingw
spencer_tseng12 小时前
JDK 9 List.of(...)
java·windows·list·1024程序员节
Wind哥12 小时前
设计模式23种-C++实现
开发语言·c++·windows·设计模式
忘忧记13 小时前
Excel拆分和合并优化版本
windows·microsoft·excel