Home > Net >  How can I read this csv data?
How can I read this csv data?

Time:10-04

I'm getting error:

Error tokenizing data. C error: Expected 1 fields in line 88, saw 4

while trying to read this data:

import pandas as pd
df = pd.read_csv('https://github.com/owid/covid-19-data/blob/master/public/data/vaccinations/vaccinations.csv')
data = df.head()

I've tried with sep = ";" etc but it doesn't help. Any suggestions on how to solve this?

CodePudding user response:

Looks like that you are pulling in the GitHub UI and not the csv with your link

https://github.com/owid/covid-19-data/blob/master/public/data/vaccinations/vaccinations.csv

Try this as this is the raw csv:

https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/vaccinations/vaccinations.csv

Further as Thomas said, a CSV is a comma, as in (,) separated file - not a semicolon (;).

  • Related