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

相关推荐
bbq烤鸡2 小时前
Win11 资源管理器“白条“修复报告
windows
10mAh3 小时前
【Java】ArrayList 遍历删除为什么报错?三种写法与漏删复现
java·开发语言·windows
瑶山6 小时前
Windows + WSL2 Ubuntu + VS Code配置C++开发环境
开发语言·c++·windows·vscode·wsl
在角落发呆7 小时前
一键脚本配置备份方法:从 Shell 脚本到自动备份
网络·windows
水饺编程7 小时前
第1章,[Win32 章节]:在 VS2019 里面安装 MSDN
c语言·c++·windows·visual studio
水饺编程8 小时前
第1章,[Win32 章节]:编程环境与 MSDN
c语言·c++·windows·visual studio
丨白色风车丨8 小时前
Python中JSON与字典/列表的相互转换详解
windows·python·json
瑶山8 小时前
Windows 11 一键安装命令安装 WSL2到D盘
windows·wsl
bug和崩溃我都要17 小时前
QT 开发的专业截图录屏工具 - macOS版 / Windows版
windows·qt·mac·录屏·截屏
kimloner17 小时前
开源一个 376KB 的 Windows 桌面小工具:便签 + 截图标注 + OCR + 待办提醒(C# / WinForms)
windows·开源·c#·ocr·winforms