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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 52 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply