Nov-28-2020, 01:29 AM
(This post was last modified: Nov-28-2020, 01:29 AM by shirleylam852.)
@perfringo
https://ww3.hunter.cuny.edu/screencasts/...?video=5.5
Okay he told me to remove the last line from that video and You will need to replace that line with a loop that goes through the 3 most frequently mentioned usernames and prints the username followed by its count. Which I think is the above code I need to edit and change to match my other code? but I forgot what to input bc looking at it for so long got me lost.
I think I understand your first question :
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:
with open('nytimes.tweets') as lines:
for line in lines:
print(line)
but we don't want to open 12 files one by one instead we go through filename for @ and mention the top 3 most mentioned
https://ww3.hunter.cuny.edu/screencasts/...?video=5.5
Okay he told me to remove the last line from that video and You will need to replace that line with a loop that goes through the 3 most frequently mentioned usernames and prints the username followed by its count. Which I think is the above code I need to edit and change to match my other code? but I forgot what to input bc looking at it for so long got me lost.
I think I understand your first question :
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:
with open('nytimes.tweets') as lines:
for line in lines:
print(line)
but we don't want to open 12 files one by one instead we go through filename for @ and mention the top 3 most mentioned