Building The Final Training Set

word_counts_per_sms = {unique_word:len(training['SMS'])*[0] for unique_word in vocabulary} 

for index, sms in enumerate(training['SMS']):
    for word in sms:
        word_counts_per_sms[word][index] += 1

How does the second for loop work? Not sure at all it looks like two keys?

The link is above for my question

It is the the 5th step in guided project for Naive Baye’s Algorithm

Hi @matthewsolomon2011:
Please attach the mission link and format your code as per these guidelines so we know the particular mission you are referring to and can better assist.

Was that fine or would you like more information?

First key is for word_counts_per_sms dictionary and second key (index) is for list stored in word_counts_per_sms[word].

Ohhh so this was never for two keys for a dictionary. It is one key and accessing the list within the value for that key?

Yes that is right, more precise we can say first is key for dictionary and second is index for list.