Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python csv read header only

import csv    

with open(fpath, 'r') as infile:
    reader = csv.DictReader(infile)
    fieldnames = reader.fieldnames
Comment

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')
Comment

PREVIOUS NEXT
Code Example
Python :: python drop axis 
Python :: pygame escape key 
Python :: libreoffice add line in table 
Python :: how to set background color of an image to transparent in pygame 
Python :: get requests from python 
Python :: how to check if index is out of range python 
Python :: plotly backend pandas 
Python :: termcolor python 
Python :: sample randomforest hyperparameter tuning 
Python :: datetime to milliseconds python 
Python :: Basic method of Converting List to Dataframe 
Python :: how to count non null values in pandas 
Python :: making variable if it is none python 
Python :: how to get seconds from datetime in python 
Python :: difference between sort and sorted 
Python :: python get username windows 
Python :: draw a circle in python turtle 
Python :: column contains substring python 
Python :: python pandas series to dataframe 
Python :: cv2 yellow color range 
Python :: python open file relative to module 
Python :: python csv reader 
Python :: list to excel python 
Python :: create 2d list dictionary 
Python :: python print user input 
Python :: How to Convert Strings to Datetime in Pandas DataFrame 
Python :: how to write multi line lambda in python 
Python :: pandas row where value in list 
Python :: download a file from url python 
Python :: flask render_template 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =