Import data from CSV to dictionary
def parse_file(datafile): data = [] with open(datafile, 'r') as f: r = csv.DictReader(f) for line in r: data.append(line) return data