import csv with different number of columns per row using Pandas

Supplying a list of columns names in the read_csv() should do the trick.

ex: names=[‘a’, ‘b’, ‘c’, ‘d’, ‘e’]

https://github.com/pydata/pandas/issues/2981

Edit: if you don’t want to supply column names then do what Nicholas suggested

Leave a Comment