SOCNYC-Assign3 - Google Docs R ||||| The Future of the Gig Professionals: A... Intro bbhosted.cuny.edu how...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
SOCNYC-Assign3 - Google Docs R ||||| The Future of the Gig Professionals: A... Intro bbhosted.cuny.edu how do i set the folder path to a folder... Take-home test for Unit 5 with open('nytimes. tweets') as lines: for line in lines: print(line) @ At-Home Tests - 2023 Spring Term (1)... Mentions Take-home test for Unit 5 You are given a collection of text files, each containing 1000 recent tweets posted by several popular Twitter accounts. Each line in a file is one tweet, so if we read the files the usual way, each line will corresponds to a separate tweet: If you are getting a decoding error, to correctly open UTF-8 encoded text files, use a variant of the function open: C Homework Help - Q&A from Online Tu... y + SOCNYC-Assign3 - Google Docs R ||||| The Future of the Gig Professionals: A... bbhosted.cuny.edu how do i set the folder path to a folder... At-Home Tests - 2023 Spring Term (1)... If you are getting a decoding error, to correctly open UTF-8 encoded text files, use a variant of the function open: with open('nytimes. tweets', encoding='utf-8') as lines: for line in lines: print(line) Take-home test for Unit 5 A username prefixed with @ is called a mention. For example, the tweet below contains four mentions (@voguemagazine, @FentyOfficial, @ethjgreen, and @yusefhairnyc): Rihanna @rihanna Oct 9, 2019 So proud to be on another cover of @voguemagazine wearing my own designs from @FentyOfficial !!! On stands October 16th! Photographer: @ethjgreen Fashion Editor: Tonne Goodman Hair: @yusefhairnyc Makeup: Kanako Takase vogue.cm/Tp750AW The above tweet is represented by the following string in the text file rihanna. tweets, any mention can be identified a word that starts with @ : So proud to be on another cover of @voguemagazine wearing my own designs from @FentyOfficial !!! On stands October 16th! Photographer: @ethjgreen Fashion Editor: Tonne Goodman Hair: @yusefhairnyc Makeup: Kanako Takase https//vogue.cm/Tp750AW pic.twitter.com/LU9TEe1NEh Task We will write a program for finding the most frequently mentioned usernames in each of the provided files. To correctly identify mentions, we have to cleanup each tweet, keeping only letters, digits, and symbols @ and _. After each Homework Help - Q&A from Online Tu... DIDO Take-home test for Unit 5 C @ Mentions y + SOCNYC-Assign3 - Google Docs R The Future of the Gig Professionals: A... ||||| nytimes. tweets bbhosted.cuny.edu Task We will write a program for finding the most frequently mentioned usernames in each of the provided files. To correctly identify mentions, we have to cleanup each tweet, keeping only letters, digits, and symbols @and. After each tweet is cleaned up, we have to go through its words, and if the word starts with @, it is a mention. how do i set the folder path to a folder... Step-by-step: 1. Modify function cleanedup so that it keeps not only letters, but also digits 0123456789 and symbols @ and 2. Write a new function findMentions that takes a filename as a parameter and reports 3 usernames most frequently mentioned in that file. The function should create a dictionary of counts for all username mentions (words starting with @). After reading through the file and accumulating the counts for all mentioned usernames, use the dictionary to create a list like this: [[15, '@alice'], [20, '@bob'], [7, '@carol'], ... ] @caityweaver 3 At-Home Tests - 2023 Spring Term (1)... Use sort to sort the above list and print out 3 most frequently mentioned usernames. 3. Check each file in the current folder (using os.listdir('.') ), if the file name ends with .tweets, call findMentions on the file to find its most frequent mentions. @nytmag 5 @nytparenting 5 justinbieber. tweets Take-home test for Unit 5 Example output If you copy all provided .tweets files in the folder with your script, its output will look as follows: C Homework Help - Q&A from Online Tu... Task t here to chong neck tant de les fes et bon and the ch y + SOCNYC-Assign3 - Google Docs The Future of the Gig Professionals: A... nytimes. tweets R @caityweaver 3 @nytmag 5 @nytparenting 5 justinbieber. tweets Example output If you copy all provided .tweets files in the folder with your script, its output will look as follows: @applemusic 15 @theellenshow 15 @skrillex 20 aoc.tweets @rashidatlaib 5 @ayannapressley 6 @ilhanmn 9 espn. tweets @nba 21 @thecheckdown 29 @kingjames 32 rihanna. tweets @rihanna 21 @savagexfenty 29 @fentybeauty 48. amyschumer. tweets @bridgeteverett @rachelfeinstein 15 @comedycentral 49 ladygaga. tweets bbhosted.cuny.edu how do i set the folder path to a folder... At-Home Tests - 2023 Spring Term (1)... Take-home test for Unit 5 Homework Help - Q&A from Online Tu... Task Step-by-step C Example output to gigan with They of all Cha y + SOCNYC-Assign3 - Google Docs R The Future of the Gig Professionals: A... @comedycentral 49 ladygaga. tweets @ahsfx 10 @btwfoundation 11 @applemusic 13 BillGates. tweets ||| @theeconomist 11 @warrenbuffett 15 @melindagates 18. BarackObama. tweets @ofa 5 @vp 5 @michelleobama 9 ID_AA_Carmack. tweets @boztank 3 @joerogan 3 @elonmusk 5 Kaepernick7. tweets @mikailsprice 26 @darthkaepernick 28 @kaepernick7 138 doctorow. tweets @cbc 3 @doctorow 3 @sensanders 7 i bbhosted.cuny.edu how do i set the folder path to a folder... At-Home Tests - 2023 Spring Term (1)... Take-home test for Unit 5 The summary of each .tweets file does not have to appear in the same order shown above, but each username must be followed by its count, and the lines must be sorted by count in increasing order. C Homework Help - Q&A from Online Tu... Example output y + SOCNYC-Assign3 - Google Docs The Future of the Gig Professionals: A... BarackObama. tweets @ofa 5 @vp 5 @michelleobama 9 R ID_AA_Carmack. tweets @boztank 3 @joerogan 3 @elonmusk 5 Kaepernick7. tweets @mikailsprice 26 @darthkaepernick 28 @kaepernick7 138 doctorow. tweets @cbc 3 @doctorow 3 @sensanders 7 1 A Last updated 2020-11-11 11:02:07 -0500 bbhosted.cuny.edu how do i set the folder path to a folder... At-Home Tests - 2023 Spring Term (1)... Take-home test for Unit 5 The summary of each .tweets file does not have to appear in the same order shown above, but each username must be followed by its count, and the lines must be sorted by count in increasing order. Your program's output must look as close as possible to what is shown above. In particular, if your program's output contains anything that looks like [3, '@caityweaver'], that is not correct! Homework Help - Q&A from Online Tu... dide C y + SOCNYC-Assign3 - Google Docs R ||||| The Future of the Gig Professionals: A... Intro bbhosted.cuny.edu how do i set the folder path to a folder... Take-home test for Unit 5 with open('nytimes. tweets') as lines: for line in lines: print(line) @ At-Home Tests - 2023 Spring Term (1)... Mentions Take-home test for Unit 5 You are given a collection of text files, each containing 1000 recent tweets posted by several popular Twitter accounts. Each line in a file is one tweet, so if we read the files the usual way, each line will corresponds to a separate tweet: If you are getting a decoding error, to correctly open UTF-8 encoded text files, use a variant of the function open: C Homework Help - Q&A from Online Tu... y + SOCNYC-Assign3 - Google Docs R ||||| The Future of the Gig Professionals: A... bbhosted.cuny.edu how do i set the folder path to a folder... At-Home Tests - 2023 Spring Term (1)... If you are getting a decoding error, to correctly open UTF-8 encoded text files, use a variant of the function open: with open('nytimes. tweets', encoding='utf-8') as lines: for line in lines: print(line) Take-home test for Unit 5 A username prefixed with @ is called a mention. For example, the tweet below contains four mentions (@voguemagazine, @FentyOfficial, @ethjgreen, and @yusefhairnyc): Rihanna @rihanna Oct 9, 2019 So proud to be on another cover of @voguemagazine wearing my own designs from @FentyOfficial !!! On stands October 16th! Photographer: @ethjgreen Fashion Editor: Tonne Goodman Hair: @yusefhairnyc Makeup: Kanako Takase vogue.cm/Tp750AW The above tweet is represented by the following string in the text file rihanna. tweets, any mention can be identified a word that starts with @ : So proud to be on another cover of @voguemagazine wearing my own designs from @FentyOfficial !!! On stands October 16th! Photographer: @ethjgreen Fashion Editor: Tonne Goodman Hair: @yusefhairnyc Makeup: Kanako Takase https//vogue.cm/Tp750AW pic.twitter.com/LU9TEe1NEh Task We will write a program for finding the most frequently mentioned usernames in each of the provided files. To correctly identify mentions, we have to cleanup each tweet, keeping only letters, digits, and symbols @ and _. After each Homework Help - Q&A from Online Tu... DIDO Take-home test for Unit 5 C @ Mentions y + SOCNYC-Assign3 - Google Docs R The Future of the Gig Professionals: A... ||||| nytimes. tweets bbhosted.cuny.edu Task We will write a program for finding the most frequently mentioned usernames in each of the provided files. To correctly identify mentions, we have to cleanup each tweet, keeping only letters, digits, and symbols @and. After each tweet is cleaned up, we have to go through its words, and if the word starts with @, it is a mention. how do i set the folder path to a folder... Step-by-step: 1. Modify function cleanedup so that it keeps not only letters, but also digits 0123456789 and symbols @ and 2. Write a new function findMentions that takes a filename as a parameter and reports 3 usernames most frequently mentioned in that file. The function should create a dictionary of counts for all username mentions (words starting with @). After reading through the file and accumulating the counts for all mentioned usernames, use the dictionary to create a list like this: [[15, '@alice'], [20, '@bob'], [7, '@carol'], ... ] @caityweaver 3 At-Home Tests - 2023 Spring Term (1)... Use sort to sort the above list and print out 3 most frequently mentioned usernames. 3. Check each file in the current folder (using os.listdir('.') ), if the file name ends with .tweets, call findMentions on the file to find its most frequent mentions. @nytmag 5 @nytparenting 5 justinbieber. tweets Take-home test for Unit 5 Example output If you copy all provided .tweets files in the folder with your script, its output will look as follows: C Homework Help - Q&A from Online Tu... Task t here to chong neck tant de les fes et bon and the ch y + SOCNYC-Assign3 - Google Docs The Future of the Gig Professionals: A... nytimes. tweets R @caityweaver 3 @nytmag 5 @nytparenting 5 justinbieber. tweets Example output If you copy all provided .tweets files in the folder with your script, its output will look as follows: @applemusic 15 @theellenshow 15 @skrillex 20 aoc.tweets @rashidatlaib 5 @ayannapressley 6 @ilhanmn 9 espn. tweets @nba 21 @thecheckdown 29 @kingjames 32 rihanna. tweets @rihanna 21 @savagexfenty 29 @fentybeauty 48. amyschumer. tweets @bridgeteverett @rachelfeinstein 15 @comedycentral 49 ladygaga. tweets bbhosted.cuny.edu how do i set the folder path to a folder... At-Home Tests - 2023 Spring Term (1)... Take-home test for Unit 5 Homework Help - Q&A from Online Tu... Task Step-by-step C Example output to gigan with They of all Cha y + SOCNYC-Assign3 - Google Docs R The Future of the Gig Professionals: A... @comedycentral 49 ladygaga. tweets @ahsfx 10 @btwfoundation 11 @applemusic 13 BillGates. tweets ||| @theeconomist 11 @warrenbuffett 15 @melindagates 18. BarackObama. tweets @ofa 5 @vp 5 @michelleobama 9 ID_AA_Carmack. tweets @boztank 3 @joerogan 3 @elonmusk 5 Kaepernick7. tweets @mikailsprice 26 @darthkaepernick 28 @kaepernick7 138 doctorow. tweets @cbc 3 @doctorow 3 @sensanders 7 i bbhosted.cuny.edu how do i set the folder path to a folder... At-Home Tests - 2023 Spring Term (1)... Take-home test for Unit 5 The summary of each .tweets file does not have to appear in the same order shown above, but each username must be followed by its count, and the lines must be sorted by count in increasing order. C Homework Help - Q&A from Online Tu... Example output y + SOCNYC-Assign3 - Google Docs The Future of the Gig Professionals: A... BarackObama. tweets @ofa 5 @vp 5 @michelleobama 9 R ID_AA_Carmack. tweets @boztank 3 @joerogan 3 @elonmusk 5 Kaepernick7. tweets @mikailsprice 26 @darthkaepernick 28 @kaepernick7 138 doctorow. tweets @cbc 3 @doctorow 3 @sensanders 7 1 A Last updated 2020-11-11 11:02:07 -0500 bbhosted.cuny.edu how do i set the folder path to a folder... At-Home Tests - 2023 Spring Term (1)... Take-home test for Unit 5 The summary of each .tweets file does not have to appear in the same order shown above, but each username must be followed by its count, and the lines must be sorted by count in increasing order. Your program's output must look as close as possible to what is shown above. In particular, if your program's output contains anything that looks like [3, '@caityweaver'], that is not correct! Homework Help - Q&A from Online Tu... dide C y +
Expert Answer:
Related Book For
International Marketing And Export Management
ISBN: 9781292016924
8th Edition
Authors: Gerald Albaum , Alexander Josiassen , Edwin Duerr
Posted Date:
Students also viewed these programming questions
-
What kinds of functions of local government are usually protected by immunity?
-
1-How many torts did you find in the Tortville scenario? 2-Identify any potential defenses. 3-Identify the negligence part of this scenario. It was a beautiful fall evening in Tortville, Indiana, and...
-
First Simple Bank pays 6.8 percent simple interest on its investment accounts. If First Complex Bank pays interest on its accounts compounded annually, what rate should the bank set if it wants to...
-
As the marketing manager for Independent Packaging Pty Ltd, you have asked the accountant what it costs to make the Container2000 model because you want to set a price for the container. A similar...
-
Dave Fletcher, the general manager of North Carolina Engineering Corporation ( NCEC), thinks that his firms engineering services contracted to highway construction firms are directly related to the...
-
Task 1: Create a JavaBean Coffee Bean with the following: - Data members: int numSugar; double price; String typeCoffee; Methods: Constructor Accessor Mutator Task 2: Create a HTML CoffeeOrder.html...
-
For the circuit of Fig.4.141 (a) Does VC increase or decrease if RB is increased? (b) Does IC increase or decrease if β is reduced? (c) What happens to the saturation current if...
-
sin x + cos x y = sin x cos X dy then dx
-
Post software Incorporated has a quick ratio of 2 . 0 0 X 2 4 , 7 5 0 in cash $ 1 3 , 7 5 0 in accounts receivable some inventory total current assets of 5 5 , 0 0 0 and total current liabilities of...
-
Marketing Management EXPLAIN THE FOLLOWING WITH EXAMPLES Developing Brand positioning Positioning Value positioning the competitive frame of reference category membership Examine competition from...
-
The trial balance of Lax Ltd at 3 0 June 2 0 2 4 was as shown below. LAX LTD Trial Balance as at 3 0 June 2 0 2 4 Debit Credit Share capital ( ordinary shares issued at $ 2 , fully paid ) $ 2 0 0 ...
-
Suppose that you own 100 shares of the underlying stock. You would like to use options to protect the returns from your ownership this stock for the life of this option. More specifically, you would...
-
Revise your part before discuss the case law. Provide your revision about Care, Skill and Dilligence in Corporation Act 2 0 0 1 includes statutory law, general law duties, defences and remedies. ...
-
Kling Investments Ltd (Kling) is a large company that has the majority of its capital invested in the financial services sector, mainly insurance businesses. The accounts department of Kling produced...
-
Using Apple, demonstrate how the differentiation strategy can be well implemented.
-
What are psychic, psychological and cultural distances? How useful is it to a manager to be able to measure (by index or scales) such distance between countries? Explain.
-
Explain the meaning of cultural universals. Do these provide universal guides to behaviour in all societies? How can the international marketer use these universals? Explain.
-
Trust has been described as a key element of any relationship between exporter and importer. How does trust affect relationships, and how does an exporter adapt when cultures differ in their views of...
-
List some BOs for this term and explain their role.
-
Identify the EBT for the word Change and give reasons for this choice.
-
Create three more patterns for change. Use three different scenarios.
Study smarter with the SolutionInn App