python - 打开应用程序时使用 Python 打开特定的 Excel 工作表
问题描述
使用 python 命令打开应用程序时,有没有办法指定在 excel 工作簿中打开哪个工作表?(例如:使用 win32 Dispatch 或 os.system)?
解决方案
我发现与熊猫相处最简单的方法:
import pandas as pd
df = pd.read_excel('path/to/sheet.xlsx', 'sheet_name')
您可以在此处阅读文档:https ://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_excel.html
推荐阅读
- android - 所有代码均未在 SkuDetailsResponseListener 内执行
- json - JSON 中不可读的文本
- python - 当我要求它只接受整数和浮点数时,为什么我在 python 中的验证尝试接受字母?
- html - 移动设备上出现错误的响应式导航
- php - 如何使用 smarty 或 php 从 jquery 发布请求中读取数据
- angular - 一旦应用程序部署在 VPS 服务器中,如何将 Angular 前端连接到 Spring Boot 后端?
- python - sg.Output 中未对齐的 Excel 表的问题
- swift - Starscream 的 Swift 背景 websocket
- ckeditor4.x - 使用 AutoGrow 插件时 CkEditor 不再响应
- npm - 如何创建像 create-react-app 这样的自定义 npm 命令?