Answers for "python csv read header only"

0

python csv read header only

import csv    

with open(fpath, 'r') as infile:
    reader = csv.DictReader(infile)
    fieldnames = reader.fieldnames
Posted by: Guest on August-19-2021
1

read header of csv file python

In [27]: df 
Out[27]: 
          A         B         C
0 -0.166919  0.979728 -0.632955
1 -0.297953 -0.912674 -1.365463
2 -0.120211 -0.540679 -0.680481
In [28]: df.columns
Out[28]: Index (['A', 'B', 'C'], dtype='object')
Posted by: Guest on July-05-2021

Code answers related to "python csv read header only"

Python Answers by Framework

Browse Popular Code Answers by Language