I have an 'Invalid Syntax' error on the 'else' line and I have no idea why, any help would be appreciated
def isolate_tfidfs(dictionary):
new_dict = {}
for word in dictionary:
for docid in dictionary[word]:
if docid in new_dict.keys():
new_dict[docid].append(dictionary[word][docid]
else:
new_dict.update(docid:[dictionary[word][docid])
return new_dict
Aucun commentaire:
Enregistrer un commentaire