abuteau abuteau - 1 year ago 201
Python Question

Python Pandas Error tokenizing data

I try to use Pandas to manipulate a .csv files but I get this error:

pandas.parser.CParserError: Error tokenizing data. C error: Expected 2 fields in line 3, saw 12

I have tried to read the Pandas doc, but found nothing.

My code is simple:

path = 'GOOG Key Ratios.csv'
data = pd.read_csv(path)

How can I resolve this ? Should I use the csv module or an other langage ?

Thanks folks.

File is from Morningstar

Answer Source

you could also try;

data = pd.read_csv('file1.csv', error_bad_lines=False)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download