0
Python pandas: Issue reading csv file (data format)
I've an issue with this csv file (https://github.com/pcm-dpc/COVID-19/blob/master/dati-andamento-nazionale/dpc-covid19-ita-andamento-nazionale.csv). When I read it with the instruction pd.read_csv('.... .csv'), I get this error "ParserError: Error tokenizing data. C error: Expected 2 fields in line 11, saw 3". The problem should be the data format, but I don't know hot to solve it. Here it is the code, if you wanna try: import pandas as pd import matplotlib.pyplot as plt import numpy as np data_path = 'https://github.com/pcm-dpc/COVID-19/blob/master/dati-regioni/dpc-covid19-ita-regioni.csv' data = pd.read_csv(data_path) print(data.head()) print(data.describe())
1 Resposta
+ 1
use the raw data link instead the one you are using .
data_path = "https://raw.githubusercontent.com/pcm-dpc/COVID-19/master/dati-andamento-nazionale/dpc-covid19-ita-andamento-nazionale.csv"