Skip to content

Instantly share code, notes, and snippets.

@natereed
Created November 5, 2015 21:12
Show Gist options
  • Save natereed/1778482b9797e2489014 to your computer and use it in GitHub Desktop.
Save natereed/1778482b9797e2489014 to your computer and use it in GitHub Desktop.
Read the headers of a csv file into fieldnames for reading with csv.DictReader
def read_fieldnames(path):
with open(path, "r") as path_csv:
reader = csv.reader(path_csv)
row = reader.next()
return row
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment