Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Combining Data for Analysis!
You have completed Combining Data for Analysis!
Preview
Welcome! In this video, we'll wrap up our workshop on combining data and I'll share some final thoughts on the dataset used throughout the workshop.
Alternative steps to combine data
# Merge Billboard 2017-2018 and Spotify 2017-2018
bs0 = pd.merge(billboard, spotify, how='left', on=['Name', 'Artists', 'BB.Week'])
# Merge Billboard 2019 and Spotify 2019
bs19 = pd.merge(billboard19, spotify19, how='left', on=['Name', 'Artists', 'BB.Week'])
# Concatenate 2017-2018 dataset and 2019 dataset
bs_final = pd.concat([bs0, bs19])
# Confirm dimensions are identical
bs_final.shape
bill_spot_final.shape
Additional Resources
- pandas API - alternate .merge() function
- pandas API - .join() function
- pandas API - .append() function - This has since been depreciated and we should be using concat
- Kaggle Data - Songs from Billboard 1999-2019
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
Pandas and are ready to make strides
in your data analysis projects.
0:00
I do want to address a few things that may
impact how you approach future projects.
0:01
First, our data is case sensitive.
0:06
When I first reviewed this data set,
Ariana's song names were in the proper
0:09
case on the Billboard chart, but
in all lowercase on the Spotify chart.
0:13
If we were to try to merge
the data with this mismatch,
0:17
we would have been unsuccessful.
0:20
In other words, No Tears Left to Cry
in proper case is different from
0:23
no tears left to cry in all lowercase.
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up