这段代码给我一个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'
df
答案 0 :(得分:-1)
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'
另一种解决方案是使用!
shell命令来更改目录,
您可以编写!cd
和!ls
之类的命令来将目录更改为当前文件。