I am getting the following error:
pandas.errors.ParserError: '|' expected after '"'
The reason is because the first line has '"'
that shouldn't be there:
"Name|Kind|Color|Price
I tried the following:
`pd.read_csv(filename, sep='|', usecols=fields, engine='python')`
Which produces the above error.
pd.read_csv(filename, sep='|', usecols=fields, engine='python', quotechar='"', error_bad_lines=False)
This doesn't work because it drops the whole line which I need because it's column headers.
Is there a way to fix this without rewriting the file? Maybe read it into a string and remove '"',
but then how do I read that string with the following?
pd.read_csv(filename, sep='|', usecols=fields, engine='python')