을에서 두 개의 열을 csv 키를 사전에 그리고 나머지 행의의 값 dictionarypython
코드 예제
1
0
읽 csv 및 저장소에서 사전 python
import csv
with open('coors.csv', mode='r') as infile:
reader = csv.reader(infile)
with open('coors_new.csv', mode='w') as outfile:
writer = csv.writer(outfile)
mydict = {rows[0]:rows[1] for rows in reader}