tkue
6/8/2017 - 12:32 AM

Import data from CSV to dictionary

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