Python Pandas Error tokenizing data

you could also try;

data = pd.read_csv('file1.csv', on_bad_lines="skip")

Do note that this will cause the offending lines to be skipped.

Edit

For Pandas < 1.3.0 try

data = pd.read_csv("file1.csv", error_bad_lines=False)

as per pandas API reference.

Leave a Comment