Python Forum
pandas.errors.ParserError: Error tokenizing data. C error: Expected 9 fields in line
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pandas.errors.ParserError: Error tokenizing data. C error: Expected 9 fields in line
#1
Using Pandas to manipulate CSV file which return me this error
Quote:


X = pd.read_csv(r"D:\Clustering\text-cluster-master\text-cluster-master\Articles.csv", index_col='id')
X.head()
Debugging errors
<frame not available>
read, parsers.py:2056
read, parsers.py:1052
_read, parsers.py:463
read_csv, parsers.py:605
<module>, similarity.py:58

Running time error
Error:
D:\Python3.8.0\Python\python.exe D:/Clustering/text-cluster-master/similarity.py Traceback (most recent call last): File "D:/Clustering/text-cluster-master/similarity.py", line 58, in <module> X = pd.read_csv(r"D:\Clustering\text-cluster-master\text-cluster-master\Articles.csv", index_col='id') File "D:\Python3.8.0\Python\lib\site-packages\pandas\io\parsers.py", line 605, in read_csv return _read(filepath_or_buffer, kwds) File "D:\Python3.8.0\Python\lib\site-packages\pandas\io\parsers.py", line 463, in _read return parser.read(nrows) File "D:\Python3.8.0\Python\lib\site-packages\pandas\io\parsers.py", line 1052, in read index, columns, col_dict = self._engine.read(nrows) File "D:\Python3.8.0\Python\lib\site-packages\pandas\io\parsers.py", line 2056, in read data = self._reader.read(nrows) File "pandas\_libs\parsers.pyx", line 756, in pandas._libs.parsers.TextReader.read File "pandas\_libs\parsers.pyx", line 771, in pandas._libs.parsers.TextReader._read_low_memory File "pandas\_libs\parsers.pyx", line 827, in pandas._libs.parsers.TextReader._read_rows File "pandas\_libs\parsers.pyx", line 814, in pandas._libs.parsers.TextReader._tokenize_rows File "pandas\_libs\parsers.pyx", line 1951, in pandas._libs.parsers.raise_parser_error pandas.errors.ParserError: Error tokenizing data. C error: Expected 9 fields in line 4, saw 10
Reply


Messages In This Thread
pandas.errors.ParserError: Error tokenizing data. C error: Expected 9 fields in line - by Anldra12 - Jun-13-2021, 07:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Better python library to create ER Diagram by using pandas data frames as tables klllmmm 0 1,315 Oct-19-2023, 01:01 PM
Last Post: klllmmm
  Using pyodbc&pandas to load a Table data to df tester_V 3 948 Sep-09-2023, 08:55 PM
Last Post: tester_V
  Likert survey data plot error Andrzej_Andrzej 6 1,624 Jul-16-2023, 10:11 PM
Last Post: deanhystad
  pyarrow error when importing pandas sravva 1 1,048 Jun-06-2023, 05:09 PM
Last Post: snippsat
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 12,858 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan
  Read nested data from JSON - Getting an error marlonbown 5 1,517 Nov-23-2022, 03:51 PM
Last Post: snippsat
  Plotly send pandas.errors.UndefinedVariableError. Frankduc 3 1,483 Oct-27-2022, 02:26 PM
Last Post: deanhystad
  Pandas - error when running Pycharm, but works on cmd line zxcv101 1 1,424 Jun-18-2022, 01:09 PM
Last Post: snippsat
  Compare fields from two csv files georgebijum 3 1,478 Apr-25-2022, 11:16 PM
Last Post: Pedroski55
  Move a particular row in pandas data frame to last row klllmmm 0 3,953 Dec-27-2021, 09:11 AM
Last Post: klllmmm

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020