Skip to content

Instantly share code, notes, and snippets.

@0guzhan
Created November 19, 2018 22:20
Show Gist options
  • Save 0guzhan/dba88f3086b73db15052c2b760bb1320 to your computer and use it in GitHub Desktop.
Save 0guzhan/dba88f3086b73db15052c2b760bb1320 to your computer and use it in GitHub Desktop.
read csv
import csv
def read_csv(path, num_lines = 10):
with open(path,"r") as f:
reader = csv.reader(f)
next(reader, None)
i = 0
for row in reader:
print(row)
i=i+1
if (i == num_lines):
break
read_csv("US_births_1994-2003_CDC_NCHS.csv")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment