python-pandas获取excel表中每个sheet的名称

安装 pandas

首先确保安装了 pandas 和 openpyxl(用于处理 Excel 文件)

python 复制代码
pip install pandas openpyxl

import pandas as pd

加载 Excel 文件

python 复制代码
excel_file = pd.ExcelFile('your_excel_file.xlsx')

获取所有工作表的名称

python 复制代码
sheet_names = excel_file.sheet_names
print(sheet_names)
python 复制代码
['Sheet1', 'Sheet2', 'Sheet3']
相关推荐
小白学大数据1 天前
线上故障急救:依托 OpenClaw 日志排查 403 和 503 问题
爬虫·python·selenium·数据分析
海兰1 天前
【web应用】Excel 项目数据自动化分析系统(AI 驱动分析)详细设计与部署指南(附源代码)
前端·人工智能·自动化·excel
databook1 天前
用SymPy自动因式分解:从面积拼图到代数恒等式
python·数学·动效
艳阳天_.1 天前
星瀚弹框页面实现
java·前端·python
kernelcraft1 天前
Boto3:Python 操作 AWS 的官方 SDK
开发语言·python·其他·aws
D3bugRealm1 天前
cryptography:Python 开发者的加密标准库
开发语言·python·其他
HappyAcmen1 天前
5.通义向量模型调用
python
python-码博士1 天前
PyTorch 从零实现 Flow Matching:训练、采样、画图一条龙
人工智能·pytorch·python
王小王-1231 天前
基于Python的车联网数据聚合与可视化分析平台设计与实现
python·车联网·新能源汽车·车联网聚合分析
叫我:松哥1 天前
基于Flask框架的校园二手书籍交易平台,注重校园场景的特殊需求,通过学号认证保障用户真实性
后端·python·sqlite·flask·bootstrap