- [Instructor] In this self check exercise
I'd like you to go ahead and create a word cloud
using the trends in the U.S. list
that you created in the preceding self check exercise.
So go ahead and give that a shot now
and then come back to see my results.
Okay let's go ahead and do what it is we need to do
to set up a word cloud
for the purpose of displaying the top U.S. trends
as of the recording time for this video.
So just like up above we're going to create a dictionary
that will be key value pairs
representing today's trending topics
and once again we're going to walk our way through
the already existing trends list
that we created in the previous self check exercise
and for each of those trends we're going to be creating
a new key value pair in which the key
is the trends name once again
and the value is the corresponding tweet volume.
And as we did in the previous video
or the previous couple of videos
we previously filtered out any of the tweets
that had none as their tweet volume
so we'll go ahead and execute that.
We have to set up a word cloud
and fit the words to the cloud
now I'm assuming that you're still working
in the same session
where you already configured the word cloud object
that I showed you in the preceding video
so we can just reuse that word cloud object
to create a new word cloud in this case.
So word cloud already exists in my session.
I executed the same code in this jupiter notebook
as I did in the iPython session
and when I fit words to this set of topics
it's going to enable me to create that new word cloud
and here I'm going to write that out to a file
as USTrendingTwitter.png.
Now let me go ahead and open up that file
and show it to you.
So let me just drag that onto the screen here.
So this is the word cloud and you will see some things
that were the same as the ones that we saw
for New York City as well.
There's probably a few that are different here also
because what's trending in New York City
is not necessarily what's trending
for the entire United States.