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.
More Related Contents:
- How do I read a large csv file with pandas?
- How to add pandas data to an existing csv file?
- How to read a file with a semi colon separator in pandas
- Pandas split column into multiple columns by comma
- How to read file with space separated values in pandas
- Convert commas decimal separators to dots within a Dataframe
- How to efficiently handle European decimal separators using the pandas read_csv function?
- Pandas: ValueError: cannot convert float NaN to integer
- Python Pandas read_csv skip rows but keep header
- pandas DataFrame output end of csv
- Use Multiple Character Delimiter in Python Pandas read_csv
- Get pandas.read_csv to read empty values as empty string instead of nan
- Pandas – Strip white space
- Filter string data based on its string length
- Why is pandas.to_datetime slow for non standard time format such as ‘2014/12/31’
- UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x96 in position 35: invalid start byte
- Loading multiple csv files of a folder into one dataframe
- Pandas read_csv dtype leading zeros
- pandas.read_csv from string or package data
- Pandas ParserError EOF character when reading multiple csv files to HDF5
- Pandas groupby to to_csv
- Python Pandas – Read csv file containing multiple tables
- Is there a way to speed up handling large CSVs and dataframes in python?
- Load CSV to Pandas MultiIndex DataFrame
- Pandas to_csv call is prepending a comma
- How to upload a CSV file in FastAPI and convert it into a Pandas Dataframe?
- pandas.read_csv FileNotFoundError: File b’\xe2\x80\xaa’ despite correct path
- start index at 1 for Pandas DataFrame
- pandas – convert string into list of strings [duplicate]
- Bin values based on ranges with pandas [duplicate]