1 00:00:01,040 --> 00:00:02,550 - [Instructor] In this self check exercise 2 00:00:02,550 --> 00:00:05,334 I'd like you to go ahead and create a word cloud 3 00:00:05,334 --> 00:00:08,510 using the trends in the U.S. list 4 00:00:08,510 --> 00:00:12,670 that you created in the preceding self check exercise. 5 00:00:12,670 --> 00:00:14,970 So go ahead and give that a shot now 6 00:00:14,970 --> 00:00:17,683 and then come back to see my results. 7 00:00:21,520 --> 00:00:25,040 Okay let's go ahead and do what it is we need to do 8 00:00:25,040 --> 00:00:26,500 to set up a word cloud 9 00:00:26,500 --> 00:00:29,790 for the purpose of displaying the top U.S. trends 10 00:00:29,790 --> 00:00:32,730 as of the recording time for this video. 11 00:00:32,730 --> 00:00:37,520 So just like up above we're going to create a dictionary 12 00:00:37,520 --> 00:00:39,230 that will be key value pairs 13 00:00:39,230 --> 00:00:41,610 representing today's trending topics 14 00:00:41,610 --> 00:00:44,340 and once again we're going to walk our way through 15 00:00:44,340 --> 00:00:46,640 the already existing trends list 16 00:00:46,640 --> 00:00:49,540 that we created in the previous self check exercise 17 00:00:49,540 --> 00:00:52,570 and for each of those trends we're going to be creating 18 00:00:52,570 --> 00:00:55,120 a new key value pair in which the key 19 00:00:55,120 --> 00:00:57,650 is the trends name once again 20 00:00:57,650 --> 00:01:00,553 and the value is the corresponding tweet volume. 21 00:01:02,230 --> 00:01:04,800 And as we did in the previous video 22 00:01:04,800 --> 00:01:06,110 or the previous couple of videos 23 00:01:06,110 --> 00:01:08,970 we previously filtered out any of the tweets 24 00:01:08,970 --> 00:01:11,850 that had none as their tweet volume 25 00:01:11,850 --> 00:01:13,700 so we'll go ahead and execute that. 26 00:01:13,700 --> 00:01:17,230 We have to set up a word cloud 27 00:01:17,230 --> 00:01:19,130 and fit the words to the cloud 28 00:01:19,130 --> 00:01:22,260 now I'm assuming that you're still working 29 00:01:22,260 --> 00:01:23,570 in the same session 30 00:01:23,570 --> 00:01:26,780 where you already configured the word cloud object 31 00:01:26,780 --> 00:01:29,340 that I showed you in the preceding video 32 00:01:29,340 --> 00:01:32,290 so we can just reuse that word cloud object 33 00:01:32,290 --> 00:01:34,910 to create a new word cloud in this case. 34 00:01:34,910 --> 00:01:38,870 So word cloud already exists in my session. 35 00:01:38,870 --> 00:01:43,030 I executed the same code in this jupiter notebook 36 00:01:43,030 --> 00:01:45,150 as I did in the iPython session 37 00:01:45,150 --> 00:01:48,190 and when I fit words to this set of topics 38 00:01:48,190 --> 00:01:52,030 it's going to enable me to create that new word cloud 39 00:01:52,030 --> 00:01:54,430 and here I'm going to write that out to a file 40 00:01:54,430 --> 00:01:58,120 as USTrendingTwitter.png. 41 00:01:58,120 --> 00:02:01,170 Now let me go ahead and open up that file 42 00:02:01,170 --> 00:02:02,770 and show it to you. 43 00:02:02,770 --> 00:02:04,960 So let me just drag that onto the screen here. 44 00:02:04,960 --> 00:02:09,220 So this is the word cloud and you will see some things 45 00:02:09,220 --> 00:02:11,870 that were the same as the ones that we saw 46 00:02:11,870 --> 00:02:13,550 for New York City as well. 47 00:02:13,550 --> 00:02:16,720 There's probably a few that are different here also 48 00:02:16,720 --> 00:02:19,040 because what's trending in New York City 49 00:02:19,040 --> 00:02:20,763 is not necessarily what's trending 50 00:02:20,763 --> 00:02:23,363 for the entire United States.