1 00:00:00,770 --> 00:00:02,580 How did you do in your first challenge? 2 00:00:02,580 --> 00:00:06,620 As promised, I'll show you my solution on how to merge the full Billboard and 3 00:00:06,620 --> 00:00:08,750 Spotify data frames. 4 00:00:08,750 --> 00:00:10,392 Now, I created a separate notebook so 5 00:00:10,392 --> 00:00:13,520 that I could keep track of just the challenge work. 6 00:00:13,520 --> 00:00:15,900 I added some markdown so you can follow along. 7 00:00:15,900 --> 00:00:19,670 But you can do it in all the same notebook, there's no difference. 8 00:00:19,670 --> 00:00:23,220 Remember, our data frames are named Billboard and Spotify, 9 00:00:23,220 --> 00:00:26,740 Billboard on the left, Spotify on the right. 10 00:00:26,740 --> 00:00:30,800 We want to merge these datasets into a new data frame called bill_spot, 11 00:00:30,800 --> 00:00:35,130 via a left join, on our selected columns. 12 00:00:39,130 --> 00:00:48,730 So we type, bill_spot = pd.merge( 13 00:00:48,730 --> 00:00:57,633 billboard, spotify, 14 00:00:57,633 --> 00:01:06,928 how='left, on=['Name', 15 00:01:06,928 --> 00:01:14,690 'Artists', 'BB.Week']). 16 00:01:14,690 --> 00:01:19,590 Let's check the shape of this new data frame. 17 00:01:19,590 --> 00:01:23,090 bill_spot.shape. 18 00:01:27,300 --> 00:01:32,508 And now let's compare it to the Billboard data set, billboard.shape. 19 00:01:33,914 --> 00:01:38,670 They have the same number of records, as I expected for a left join. 20 00:01:38,670 --> 00:01:43,046 Let's call the head function to check columns and the first few rows of data. 21 00:01:43,046 --> 00:01:49,227 bill_spot.head(), 22 00:01:51,306 --> 00:01:53,100 Well that's it for this one. 23 00:01:53,100 --> 00:01:56,940 In the next video, we'll learn how to concatenate two data sets with Pandas. 24 00:01:56,940 --> 00:01:59,440 See you there.