2024-05-29 00:02:04 发布
网友
这段代码给了我一个file not found错误,我不知道是不是文件位置给了我麻烦。我是Python新手。在
file not found
import pandas as pd df= pd.read_csv('breast-cancer-wisconsin.data.txt') #file location = 'C:\Users\qeee11\Downloads\breast-cancer-wisconsin.data.txt'
测向
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将目录更改为当前文件。在
!
!cd
!ls
{a1}
另一种解决方案是使用
!
shell命令来更改目录, 您可以编写命令!cd
,和!ls
将目录更改为当前文件。在相关问题 更多 >
编程相关推荐