Last active
August 29, 2015 14:16
Revisions
-
cyriac revised this gist
May 11, 2015 . 1 changed file with 3 additions and 15 deletions.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -3,19 +3,7 @@ mrows = [] # Creates list of dict from csv with open('final.csv', mode='r') as infile: reader = csv.DictReader(infile) for row in reader: mrows.append(row) header = row.keys() -
cyriac revised this gist
Apr 24, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ import csv mrows = [] # Creates list of dict from csv with open('final.csv', mode='r') as infile: -
cyriac created this gist
Mar 3, 2015 .There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ mrows = [] # Creates list of dict from csv with open('final.csv', mode='r') as infile: reader = csv.reader(infile) counter = 1 header = None rows = [] for row in reader: if counter == 1: header = row else: rows.append(row) counter = counter + 1 for row in rows: mdict = {} for i in range(len(header)): mdict[header[i]] = row[i] mrows.append(mdict)