我接受这个错误:
OSError:找不到\C:\Users\u165127\Desktop\Restaurant_Reviews.tsv。
我太困惑了!
#import the libraries
import numpy as np
import pandas as pd
#import the dataset
import scipy as sp
data = sp.genfromtxt(r'\C:\Users\u165127\Desktop\Restaurant_Reviews.tsv',delimiter='\t',encoding='utf-8')发布于 2019-04-04 00:21:46
这意味着r'\C:\Users\u165127\Desktop\Restaurant_Reviews.tsv'给出的文件位置不存在。
你可以试试:'C:\Users\u165127\Desktop\Restaurant_Reviews.tsv'
或者,如果脚本是从C:\Users\u165127\Desktop运行的,只需尝试"./Restaurant_Reviews.tsv"
发布于 2019-04-04 00:41:24
def load_csv(Restaurant_Reviews):
file = open(Restaurant_Review, 'r')
text = file.read()
file.close()
return text这是在运行,但我不明白其中的区别
https://stackoverflow.com/questions/55499833
复制相似问题