Python Pandas Error tokenizing data

后端 未结 30 2346
不知归路
不知归路 2020-11-22 04:49

I\'m trying to use pandas to manipulate a .csv file but I get this error:

pandas.parser.CParserError: Error tokenizing data. C error: Expected 2 field

30条回答
  •  后悔当初
    2020-11-22 05:26

    Sometimes the problem is not how to use python, but with the raw data.
    I got this error message

    Error tokenizing data. C error: Expected 18 fields in line 72, saw 19.
    

    It turned out that in the column description there were sometimes commas. This means that the CSV file needs to be cleaned up or another separator used.

提交回复
热议问题