Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

csv.DictReader Skip Lines

with open("myfile.csv", encoding='utf8') as fIn:
	#skip the first 100 rows 
    for i in range(100):
		#fIn.next()  # use next for python2
        fIn.readline() # use readline for python3 
	
    #open file at row 100 
    fieldnames = ["first_name","last_name"]
    reader = csv.DictReader(fIn,fieldnames=fieldnames)
	
    #now loop through file at row 101
	for row in reader:
		print(row['name'])
Comment

PREVIOUS NEXT
Code Example
Python :: how to make a square multicolor square spiral python 
Python :: python tuple range 
Python :: concatenar columnas en una del mismo dataset 
Python :: Then generate Django project from the project template of cookiecutter 
Python :: pandas print nonzero in series 
Python :: how fast is iglob 
Python :: convert a column to camel case in python 
Python :: invalid literal for int() with base 10 python 
Python :: numpy transpose shorthand 
Python :: how to code discord bot 8ball python 
Python :: Lazada link 
Python :: EXCEL , EXTRAER DELIMITADOR 
Python :: ffmpeg python slow down frame rate 
Python :: torch remove part of array 
Python :: how to click the next button on a website using python 
Python :: Return monthly sales value in Django 
Python :: scipy z value to pvalue 
Python :: get weather data from weather underground 
Python :: load xgb 
Python :: Pyturch training along with source code 
Python :: Examples pandas.read_hfd5() 
Python :: Python return statement (Write and Call Function) 
Python :: unique character 02 
Python :: looking up object address in python 
Python :: Getting TimeZone from lat long coordinate 
Python :: apropos, help 
Python :: Python NumPy moveaxis function Example 02 
Python :: tqdm start bar at 
Python :: Python NumPy row_stack Function Example with 2d array 
Python :: midpoint line drawing algorithm 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =