Page 1 of 1

Using python write a program that create a dictionary as follows: data = {'email': ['Click Win Prize', 'Click meeting se

Posted: Sat Feb 19, 2022 3:22 pm
by answerhappygod
Using python write a program that create a dictionary as
follows:
data = {'email': ['Click Win Prize', 'Click
meeting setup meeting' ,'Prize free prize ','Click prize
free'],'is_spam': ['yes',
'no','yes','yes'],'bow':['{'click' : 1,'win' :1
,'prize'=1'},{'click' :1 'meeting':2, 'setup':1},{'prize': 2,
'free':1},{'click':1 ,'prize' :1,'free':1}]}
Note that it is equivalent to
Using Python Write A Program That Create A Dictionary As Follows Data Email Click Win Prize Click Meeting Se 1
Using Python Write A Program That Create A Dictionary As Follows Data Email Click Win Prize Click Meeting Se 1 (13.35 KiB) Viewed 53 times
Please check well how the dictionary is being used and which
data structure is being used.
Note that you have to find the frequency of all
words(bow) of each emails by coding .Suppose the email and
is_spam data is already given.
Very important: You should not use any libraries. I
showed you in tabular style just for you understand the
logic.
Use the dictionary to calculate the total occurrences of a word
in each Spam and Not Spam class in python.
Thanks.
Out[11]: 0 email is_spam bow click win prize yes {"click": 1, 'win': 1, 'prize': 1} 1 click meeting setup meeting no {"click": 1, "meeting': 2, "setup: 1} prize free prize yes {"prize': 2, 'free': 1} 3 click prize free yes {"click": 1, "prize': 1, 'free': 1) N 3