I'm using the Pandas function pd.read_csv to import a txt file delimited by |. The column header has 419 fields so it's calculating them all as such. Some of the rows have more than 419 columns though.
So How would I make the data frame malleable to increasing columns as it needs or just add X amount of columns to allow for more columns down the road.
Example:
How would I account for "F"?
A B C D E
A B C D E
A B C D E F
This is the error I'm receiving. I'm using python 3 in Jupyter notebook.
ParserError: Error tokenizing data. C error: Expected 419 fields in line 7945, saw 424
This is the code I'm trying to use
data = pd.read_csv('filepath.txt', sep="|",skip_blank_lines=True, encoding = 'latin-1', header= None)
namesparam when you read:names=range(0,480)