错误:pandas.errors.ParserError: Error tokenizing data. C error: Expected 1 fields in line 5, saw 9
📁 python, Python 版本讨论:Python 3.x 最新动态, 熊猫
尝试将tsv文件加载到pandas中。
import pandas as pddf = pd.read_csv(filename, sep='\t')print(df)执行此代码后,在控制台中看到错误
df = pd.read_csv(filename, sep='\t') File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/io/parsers.py", line 655, in parser_fretu _read(filepath_or_buffer, kwds) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pandas/io/parsers.py", line 411, in _readdata = parser.read(nrows) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages