使用jupyter noteb读取xlsx文件

2024-09-13 06:16:22 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用jupyter笔记本读取存储在系统中的xlsx文件。我已从文件所在的当前目录运行jupyter笔记本。但它显示错误为“未找到模块错误”。

This is the image of the code i have written and also the error i got

This is the complete traceback


Tags: 模块文件系统错误笔记本jupyterxlsx
1条回答
网友
1楼 · 发布于 2024-09-13 06:16:22

下面的代码应该能够访问/读取您的excel文件

import xlsxwriter

import pandas as pd

from pandas import DataFrame

path = ('...\\filename.xlsx')

xl = pd.ExcelFile(path)

print(xl.sheet_names)

上面的命令显示xlsx文件中的图纸

df1 = xl.parse('Sheet1')

上面的命令解析所需的工作表

相关问题 更多 >