在Anacond中找不到文件错误

2024-05-29 00:02:04 发布

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

这段代码给了我一个file not found错误,我不知道是不是文件位置给了我麻烦。我是Python新手。在

import pandas as pd 
df= pd.read_csv('breast-cancer-wisconsin.data.txt')

#file location = 'C:\Users\qeee11\Downloads\breast-cancer-wisconsin.data.txt'

测向


Tags: 文件代码importtxtpandasdata错误not
1条回答
网友
1楼 · 发布于 2024-05-29 00:02:04
import pandas as pd 
df= pd. read_csv('breast-cancer-wisconsin.data.txt') 
# Give commands to extract the directory like getcwd()
#like , data_path = os.path.join(os.getcwd(), 'data')

file location = 'C:\Users\qeee11\Downloads\breast-cancer-wisconsin.data.txt'

{a1}

另一种解决方案是使用!shell命令来更改目录, 您可以编写命令!cd,和!ls将目录更改为当前文件。在

相关问题 更多 >

    热门问题