Get_words_by_threshold


# Test your function w2_unittest.test_get_words_by_threshold(get_words_by_threshold, freqs)

Test your function

w2_unittest.test_get_words_by_threshold(get_words_by_threshold, freqs)

Wrong number of elements in output dictionary. Expected: 13. Got: 0.
i get this error while i run my code. can someone look in to this what is the problem here is my code:

{Moderator’s Edit: Solution Code Removed}

Hey @Shahryar_Akbar,
The way in which you are using the key is incorrect. If you take a look at the freqs dictionary, which is the output of count_tweets function in the very beginning of the notebook, the keys have a structure as follows: (word, y), where word denotes the word and y denotes the label. So, you need to extract the word from the key, and not simply equate them. I hope this helps.

P.S. - Posting solution code publicly is strictly against the community guidelines. Please refrain from doing so in the future.

Cheers,
Elemento

Hey @Elemento I am so sorry about posting the solution or code online. I have tried accessing only the word present in the freqs dictionary but still i am unable to do so. I am stuck on this problem for the last two days. Although I have passed the assignment but I still want to know what wrong am i doing so that i can improve. wosfgwhbosjy this is my lab ID I would be really glad if you point out my mistake thankyou

Hey @Shahryar_Akbar,
Only the staff members have access to your labs. Please DM me your implementation of the function so that I can try to find out the issue in your modified implementation (in which I am assuming, you have implemented the above fix).

Cheers,
Elemento