Categories
Python Answers

How to fix Python Pandas Error tokenizing data?

Spread the love

To fix Python Pandas Error tokenizing data, we call read_csv with the on_bad_lines argument set to 'skip'.

For instance, we write

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

to call read_csv with the file path and the on_bad_lines argument set to 'skip' to skip the bad lines when reading the CSV.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *