1import csv
2
3with open(fpath, 'r') as infile:
4 reader = csv.DictReader(infile)
5 fieldnames = reader.fieldnames
6
1In [27]: df
2Out[27]:
3 A B C
40 -0.166919 0.979728 -0.632955
51 -0.297953 -0.912674 -1.365463
62 -0.120211 -0.540679 -0.680481
7In [28]: df.columns
8Out[28]: Index (['A', 'B', 'C'], dtype='object')
9