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 分钟前
基于tensorflow实现的猫狗识别
人工智能·python·tensorflow
大白爱琴4 分钟前
使用python进行图像处理—图像变换(6)
图像处理·人工智能·python
月忆36417 分钟前
等待组(waitgroup)
前端·爬虫·python
一个何包蛋!!23 分钟前
相关类相关的可视化图像总结
开发语言·python·数据可视化
技术便签23 分钟前
第一篇:Agent2Agent (A2A) 协议——协作式人工智能的黎明
人工智能·python·ai编程·agi·多智能体·智能体·adk
love530love36 分钟前
教程:PyCharm 中搭建多级隔离的 Poetry 环境(从 Anaconda 到项目专属.venv)
开发语言·ide·人工智能·windows·python·pycharm
Ian在掘金43 分钟前
bat+python实现easy connect自动连接
前端·python
midsummer_woo44 分钟前
【2025】pycharm 安装
ide·python·pycharm
AщYΘ1 小时前
6.6 day38
python
老胖闲聊1 小时前
Python ROS2【机器人中间件框架】 简介
python·中间件·机器人