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 :: api key python 
Python :: armstrong number function 
Python :: how to make a do while in python 
Python :: count true in a dataframe 
Python :: round() function in python 
Python :: Generation of Random Numbers in python 
Python :: how to check if a list is empty in python 
Python :: print function python 
Python :: turn list of arrays into array 
Python :: Dependency on app with no migrations: 
Python :: python http post file 
Python :: pong code python 
Python :: python main template 
Python :: robot framework log from python 
Python :: remove last element in list python 
Python :: how to get function help in jupyter notebook 
Python :: python global keyword 
Python :: pyglet on button press 
Python :: get current scene file name godot 
Python :: pandas numpy multiplicar dos columnas segun una condicion 
Python :: How to install proxy pool in scrapy? 
Python :: change group box title font size 
Python :: sphinx select code ' 
Python :: check if inf pandas dataframe 
Shell :: Error: You must install at least one postgresql-client-<version package 
Shell :: uninstall skype from ubuntu 
Shell :: dotnet ef not found 
Shell :: mvn clean install skip test 
Shell :: git match remote master 
Shell :: sqlite3 install ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =