Skip to content

Instantly share code, notes, and snippets.

@gartenfeld
Last active August 29, 2015 14:12
Show Gist options
  • Save gartenfeld/8a8996468f6fab1a671d to your computer and use it in GitHub Desktop.
Save gartenfeld/8a8996468f6fab1a671d to your computer and use it in GitHub Desktop.
Reading from the columns of a CSV file.
import csv
f = open(csv_file.csv)
# Read the CSV format, each row will become an array
rows = csv.reader(f)
for row in rows
variable_a = row[0] # The first column
variable_b = row[1] # The second column, etc.
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment