问题遇到的现象和发生背景
pycharm导入Excel表格报错
问题相关代码,请勿粘贴截图
import pandas as pd
df = pd.read_excel('F:\heart\excel.XLSX', sheet_name=1, header=None)
print(df)
运行结果及报错内容
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/pythonProject/a.py", line 162, in <module>
df = pd.read_excel('F:\\heart\\excel.XLSX', sheet_name=1, header=None)
File "E:\python3.8.2\内容\DLLs\lib\site-packages\pandas\util\_decorators.py", line 311, in wrapper
return func(*args, **kwargs)
File "E:\python3.8.2\内容\DLLs\lib\site-packages\pandas\io\excel\_base.py", line 457, in read_excel
io = ExcelFile(io, storage_options=storage_options, engine=engine)
File "E:\python3.8.2\内容\DLLs\lib\site-packages\pandas\io\excel\_base.py", line 1376, in __init__
ext = inspect_excel_format(
File "E:\python3.8.2\内容\DLLs\lib\site-packages\pandas\io\excel\_base.py", line 1250, in inspect_excel_format
with get_handle(
File "E:\python3.8.2\内容\DLLs\lib\site-packages\pandas\io\common.py", line 795, in get_handle
handle = open(handle, ioargs.mode)
FileNotFoundError: [Errno 2] No such file or directory: 'F:\\heart\\excel.XLSX'
我的解答思路和尝试过的方法
我想要达到的结果