0
任何幫助請從URL網站閱讀此文件。從UCL網站使用熊貓閱讀波士頓數據時出錯
eurl = 'https://archive.ics.uci.edu/ml/machine-learning-databases/housing/housing.data'
data = pandas.read_csv(url, sep=',', header = None)
我試過sep =',',sep =';'和SEP = '\ t',但這樣寫的
但
data = pandas.read_csv(url, sep=' ', header = None)
我收到了錯誤的數據,
pandas/parser.pyx in pandas.parser.TextReader.read (pandas/parser.c:7988)()
pandas/parser.pyx in pandas.parser.TextReader._read_low_memory (pandas/parser.c:8244)()
pandas/parser.pyx in pandas.parser.TextReader._read_rows (pandas/parser.c:8970)()
pandas/parser.pyx in pandas.parser.TextReader._tokenize_rows (pandas/parser.c:8838)()
pandas/parser.pyx in pandas.parser.raise_parser_error (pandas/parser.c:22649)()
CParserError: Error tokenizing data. C error: Expected 30 fields in line 2, saw 31
也許同樣的問題在這裏問enter link description here但接受的答案不幫助我。
任何幫助請從URL中讀取此文件提供它。
順便說一句,我知道有Boston = load_boston()來讀取這個數據,但是當我從這個函數讀取它時,數據集中的屬性'MEDV'不會與數據集一起下載。
很多人感謝你的工作 –