The csv file has the following structure:
a,b,c
a,b,c,d,e,f,g
a,b,c,d
a,b,c
if I use file = pd.read_csv('Desktop/export.csv',delimiter=',')
, it will throw a tokenizing error like this:
pandas.errors.ParserError: Error tokenizing data. C error: Expected 9 fields in line 3, saw 10
I do NOT want to skip bad lines. I want to read the csv with all columns and create a dataframe that looks like:
unnamed column1, unnamed column2, ....... unnamed column 7
a,b,c
a,b,c,d,e,f,g
a,b,c,d
a,b,c
How can I load the bad lines in the csv files?