in [ ]!cat ch /ex csv , , , ,hello , , , ,world , , , ,foo to read this inyou have couple of options you can allow pandas to assign default column namesor you can specify names yourselfin [ ]pd read_csv('ch /ex csv'header=noneout[ ] hello world foo in [ ]pd read_csv('ch /ex csv'names=[' '' '' '' ''message']out[ ] message hello world foo suppose you wanted the message column to be the index of the returned dataframe you can either indicate you want the column at index or named 'messageusing the index_col argumentin [ ]names [' '' '' '' ''message'in [ ]pd read_csv('ch /ex csv'names=namesindex_col='message'out[ ] message hello world foo in the event that you want to form hierarchical index from multiple columnsjust pass list of column numbers or namesin [ ]!cat ch /csv_mindex csv key ,key ,value ,value one, , , one, , , one, , , one, , , two, , , two, , , two, , , two, , , in [ ]parsed pd read_csv('ch /csv_mindex csv'index_col=['key ''key ']in [ ]parsed out[ ]reading and writing data in text format www it-ebooks info