Created
September 2, 2015 16:48
-
-
Save Lazhari/be811d9911894548d39d to your computer and use it in GitHub Desktop.
Parsing CSV file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def parse_file(datafile): | |
name = "" | |
data = [] | |
with open(datafile,'rb') as f: | |
r = csv.reader(f) | |
name = r.next()[1] | |
header = r.next() | |
data = [row for row in r] | |
return (name, data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment