Created
December 30, 2018 19:46
-
-
Save CamDavidsonPilon/243c39a0c4ae028d7ee1c5f4d8194ba0 to your computer and use it in GitHub Desktop.
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 characters
import csv | |
from collections import defaultdict | |
d = defaultdict(dict) | |
with open('lexicon_3.csv') as dict_: | |
csv_reader=csv.reader(dict_, delimiter=',') | |
for row in csv_reader: | |
d[row[0]][row[1]] = int(row[2]) | |
print(len(d)) | |
print(d['happy']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment