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

相关推荐
其实防守也摸鱼1 小时前
GDB安装与配置(保姆级教程)【Linux、Windows系统】
linux·运维·windows·命令模式·工具·虚拟机·调试
武藤一雄9 小时前
19个核心算法(C#版)
数据结构·windows·算法·c#·排序算法·.net·.netcore
淼淼爱喝水12 小时前
ESXi 给 Windows Server 2008 虚拟机添加磁盘教程
windows·esxi·虚拟机
勤自省12 小时前
《RDK X5 ROS 2 Humble 安装与验证:从零到 Hello World》
windows·ubuntu·ssh·ros2
docsz12 小时前
Windows开发环境配置
windows
eggwyw13 小时前
PHP搭建开发环境(Windows系统)
开发语言·windows·php
运维行者_15 小时前
通过OpManager的Windows服务监控能力释放最佳IT网络性能
服务器·开发语言·网络·windows·web安全·php
oscar99915 小时前
Windows下快速安装OpenCode及使用—PowerShell+Chocolatey
windows·opencode
元Y亨H15 小时前
Python 获取 Windows 设备信息笔记
windows·python
xiaoshuaishuai816 小时前
C# Submodule 避坑指南
服务器·数据库·windows·c#