Error tokenizing data. C error: Buffer overflow caught - possible malformed input file.

    data = self._reader.read(nrows)
  File "pandas/_libs/parsers.pyx", line 796, in pandas._libs.parsers.TextReader.read
  File "pandas/_libs/parsers.pyx", line 884, in pandas._libs.parsers.TextReader._read_rows
  File "pandas/_libs/parsers.pyx", line 861, in pandas._libs.parsers.TextReader._check_tokenize_status
  File "pandas/_libs/parsers.pyx", line 2029, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Buffer overflow caught - possible malformed input file.

解决方法:

将:topicDataDF = pd.read_csv(csvPath, low_memory=False)

改成: topicDataDF = pd.read_csv(csvPath, engine='python')

你可能感兴趣的:(问题杂记,开发语言,pandas)