Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left
Apply NowLogin using Social Account
     Continue with GoogleLogin using your credentials
Write a function count_message_from_email
which reads the file /cxldata/datasets/project/mbox-short.txt
.
This function counts how many messages have come from each email address, stores the count in a Map
, and then returns the Map
. The email can be found by second word after you split every line that starts with 'From:'
Note: If your logic is correct then your function should return a Map
like the following:
Map(zqian@umich.edu -> 4, rjlowe@iupui.edu -> 2, stephen.marquard@uct.ac.za -> 2, louis@media.berkeley.edu -> 3, gopal.ramasammycook@gmail.com -> 1, gsilver@umich.edu -> 3, david.horwitz@uct.ac.za -> 4, ray@media.berkeley.edu -> 1, antranig@caret.cam.ac.uk -> 1, wagnermr@iupui.edu -> 1, cwen@iupui.edu -> 5)
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...