How to solve File “pandas\_libs\parsers.pyx”, line 2021, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 2 fields in line 53, saw 3
Solving the problem
File “pandas\_libs\parsers.pyx”, line 2021, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. c error: Expected 2 fields in line 53, saw 3
Solution
ParserError: Error tokenizing data.
Solution
Because the read is a csv file, the separation default is comma. Analysis shows that the read data contains two fields in a certain cell, that is, the value may contain two commas.
Specify the parameters that error_bad_lines=False
data= pd.read_csv(data_file, error_bad_lines=False)
Similar Posts:
- Python: How to Read file initialization from file failed by panda
- Python pandas.read_ Oserror: initializing from file failed
- How to Solve sys:1: DtypeWarning: Columns (39,41,42,217) have mixed types.Specify dtype option on import or s
- Error in compiling APR util for Linux
- pandas.read_ Oserror: initializing from file failed
- Tensorflow error due to uninitialized variable [How to Fix]
- CentOS 7: How to Solve Mysqlclient Install Error
- [Solved] Pandas Read CSV Error: TypeError: Empty ‘DataFrame’: no numeric data to plot
- Mac version PIP install — upgrade PIP update version error
- [Solved] MySQL Import csv File[Error Code] 1290 – The MySQL server is running with the –secure-file-priv option