I am looking for a a way to read just the header row of a large number of large CSV files.
Using Pandas, I have this method available, for each csv file:
Here's one way. You get 1 row.
In [9]: DataFrame(np.random.randn(10,4),columns=list('abcd')).to_csv('test.csv',mode='w') In [10]: read_csv('test.csv',index_col=0,nrows=1) Out[10]: a b c d 0 0.365453 0.633631 -1.917368 -1.996505