Python CSV import with nested list creation
问题 I am trying to simply import a .csv into Python. I've read numerous documents but for the life of me I can't figure out how to do the following. The CSV format is as follows NYC,22,55 BOSTON,39,22 I'm trying to generate the following : {NYC = [22,55], BOSTON = [39,22]} so that I can call i[0] and i[1] in a loop for each variable. I've tried import csv input_file = csv.DictReader(open("C:\Python\Sandbox\longlat.csv")) for row in input_file: print(row) Which prints my variables, but I dont know