I have a lot of csv files that I would like to read with Pandas (pd.read_csv), however, in some of the files there is added a column midway that does not have a header, like this example:
Apples, Pears
1, 2
3, 4
5, 6, 7
If using pd.read_csv(example_file) the following error is thrown "ParserError: Error tokenizing data. C error: Expected 2 fields in line 4, saw 3"
I would like to avoid having to skip the line and instead just add a dummy header name, like Unknown1, and get the following result:
Apples, Pears, Unknown1
1, 2, np.nan
3, 4, np.nan
5, 6, 7