Python Pandas Error tokenizing data

后端 未结 30 2253
不知归路
不知归路 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

    use pandas.read_csv('CSVFILENAME',header=None,sep=', ')

    when trying to read csv data from the link

    http://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.data

    I copied the data from the site into my csvfile. It had extra spaces so used sep =', ' and it worked :)

提交回复
热议问题