python pandas 获取Excel文件下所有的sheet名称,表格数据

方法1:

一定要加sheet_name=None,才能读取出所有的sheet,否则默认读取第一个sheet,且获取到的keys是第一行的值

python 复制代码
df = pd.read_excel('自己的Excel文件路径.xlsx', sheet_name=None)  # 路径注意转义 
for i in df.keys():
   print(i)

方法2:

python 复制代码
    df = pd.read_excel('自己的Excel文件路径.xlsx', sheet_name=None)
    print(list(df))
相关推荐
团子和二花26 分钟前
openclaw平替之nanobot源码解析(七):Gateway与多渠道集成
python·gateway·agent·智能体·openclaw·nanobot
未知鱼31 分钟前
Python安全开发之简易目录扫描器(含详细注释)
开发语言·python·安全
Be1k036 分钟前
推荐一款语雀知识库批量导出工具
python·gui·工具·语雀·批量导出·原创
Sunshine for you1 小时前
如何用FastAPI构建高性能的现代API
jvm·数据库·python
阿贵---1 小时前
Python Web爬虫入门:使用Requests和BeautifulSoup
jvm·数据库·python
Red丶哞2 小时前
内网自建Postfix使用Python发送邮件
开发语言·python
rebekk2 小时前
pytorch custom op的简单介绍
人工智能·pytorch·python
chushiyunen2 小时前
uv使用笔记(python包的管理工具)
笔记·python·uv
曲幽2 小时前
FastAPI状态共享秘籍:别再让中间件、依赖和路由“各自为政”了!
python·fastapi·web·request·state·depends·middleware
风清扬【coder】2 小时前
Anaconda 被误删后抢救手册:数据恢复 + 环境重建应急流程
python·数据恢复·anaconda·环境重建