Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active Jun 9, 2016
Embed
What would you like to do?
【Python】CSVを読み込むジェネレータ関数
def csv_reader(file, header=False):
import csv
with open(file, "r") as f:
reader = csv.reader(f)
if header
next(reader)
for row in reader:
yield row
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment