logo
Loading...

ParserError (還有請問遇到問題如何查詢解答) 謝謝 - Cupoy

Path of read in data: http://localhost:8888/edit/S...

ml100-4,ml100-4-d04

ParserError (還有請問遇到問題如何查詢解答) 謝謝

2020/04/04 下午 05:38
機器學習共學討論版
cyL
觀看數:7
回答數:2
收藏數:0
ml100-4
ml100-4-d04

Path of read in data: http://localhost:8888/edit/SynologyDrive/D4%20data/application_train.csv 


--------------------------------------------------------------------------- ParserError                               Traceback (most recent call last) <ipython-input-42-a953cb587f79> in <module>       6 f_app = os.path.join(dir_data, 'application_train.csv')       7 print('Path of read in data: %s' % (f_app)) ----> 8 app_train = pd.read_csv(f_app) ~\Anaconda3\lib\site-packages\pandas\io\parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, dialect, error_bad_lines, warn_bad_lines, delim_whitespace, low_memory, memory_map, float_precision)     683         )     684 --> 685 return _read(filepath_or_buffer, kwds)     686     687     parser_f.__name__ = name  ~\Anaconda3\lib\site-packages\pandas\io\parsers.py in _read(filepath_or_buffer, kwds)     461     462 try: --> 463 data = parser.read(nrows)     464 finally:     465         parser.close() ~\Anaconda3\lib\site-packages\pandas\io\parsers.py in read(self, nrows)    1152 def read(self, nrows=None):    1153         nrows = _validate_integer("nrows", nrows) -> 1154 ret = self._engine.read(nrows)    1155    1156 # May alter columns / col_dict ~\Anaconda3\lib\site-packages\pandas\io\parsers.py in read(self, nrows)    2057 def read(self, nrows=None):    2058 try: -> 2059 data = self._reader.read(nrows)    2060 except StopIteration:    2061 if self._first_chunk: pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader.read() pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._read_low_memory() pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._read_rows() pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._tokenize_rows() pandas\_libs\parsers.pyx in pandas._libs.parsers.raise_parser_error() ParserError: Error tokenizing data. C error: Expected 1 fields in line 12, saw 2

回答列表

  • 2020/04/04 下午 11:19
    Shih Cheng Chen
    贊同數:0
    不贊同數:0
    留言數:0

     他讀到的路徑"D4%20DATA" ,%20應該是空格,把空格去掉試試看

  • 2020/04/05 上午 04:28
    張維元 (WeiYuan)
    贊同數:0
    不贊同數:0
    留言數:0

    嗨,cyL


    呃,你這樣提供的資訊太少了,應該要把造成錯誤的程式碼也一起貼上來!


    如果這個回答對你有幫助請主動點選「有幫助」的按鈕,也可以追蹤我的GITHUB帳號。若還有問題的話,也歡迎繼續再追問或者把你理解的部分整理上來,我都會提供你 Review 和 Feedback 😃😃😃