I've downloaded some data from the world bank in csv format, but when I try and read it in jupyter I get the error message: "ParserError: Error tokenizing data. C error: Expected 3 fields in line 5, saw 63."

Anyone know how to resolve this (without adjusting the original dataset, which is very large) I've tried error_bad_lines=False but this does not work

The pictures of the csv and full output are below: csv file

output first half

output second half

upvote
  flag
Show us line 5 please – Grantly
upvote
  flag
sorry was in a rush, have attached images – DDFF
upvote
  flag
I think you'll need to include some of the actual csv file - at least the header line and line 5. – Nathan Vērzemnieks

1 Answers 11

Your header row actually starts on line 5... (In other words, The CSV data rows start at line 5) Delete the first 4 lines from your file so that your header "Country Name", "Country Description", ...etc is the first line in the file.

This is quite common to have a small header on top of CSV files.

Or maybe you can configure jupyter to start the import at line 5, but I have no idea how to use jupyter

upvote
  flag
worked, thank you! – DDFF
upvote
  flag
@DDFF I'm glad it helped. Welcome to Stackoverflow. Please mark any Answer as accepted if it truly fixed your problem. – Grantly

Not the answer you're looking for? Browse other questions tagged or ask your own question.