Lets say I have a (badly formed) csv like this:
header1, header2, header3
value1, value2, value3, value4
I'd like to load this into a dataframe. However
pd.read_csv(file_data, index = False)
drops value4:
header1 | header2 | header3 |
---|---|---|
value1 | value2 | value3 |
and
pd.read_csv(file_data)
leaves me with no way to differentiate if the value of the index came from value1 in the csv file, or was autoassigned by pandas.
Is there a way to have pandas just create dummy columns on the end based on the row with the maximum number of delimiters?