top of page

Analyzing Music Artist Kendrick Lamar's Discography

Overview

I collaborated with a team member to extract Kendrick Lamar's discography data from both Spotify using the Spotipy API, and Apple Music using Beautiful Soup web scraping.

Duration
Team

Helena Grobel

1 month

Objectives

1) Compare what songs were listed as the most popular on Apple Music versus on Spotify
2) Analyze Apple Music top songs with Spotify statistics (danceability, energy)
3) Compile a list of what albums were the most popular based on which songs were the most popular (i.e., which albums have the most ‘top songs’)
4) Discover any interesting correlations in the data

Goals Achieved

Though we faced some unexpected challenges with the differences in the type of data we were able to retrieve, we were able to find the following:

  1. The 10 most popular songs from each platform were not exactly the same or in the exact same order, meaning users on different platforms listen to the songs in different amounts. The top 10 songs, in order from most to least popular, are:

    1. Spotify

      1. ('HUMBLE.'), ('All The Stars (with SZA)'), ('LOVE. FEAT. ZACARI.'), ('family ties (with Kendrick Lamar)'), ('DNA.'), ('Alright'), ('Money Trees'), ('PRIDE.'), ('Swimming Pools (Drank)’), ('King Kunta')

    2. Apple Music

      1. ('HUMBLE.'), ('LOVE. (FEAT. ZACARI.)'), ('DNA.'), ('LOYALTY. (FEAT. RIHANNA.)'), ('All The Stars'), ('Mona Lisa (feat. Kendrick Lamar)'), ("King's Dead"), ('ELEMENT.'), ('Money Trees (feat. Jay Rock)'), ('Poetic Justice (feat. Drake)')

  2. Kendrick Lamar’s most popular albums, based on the number of top songs per album were:

    1. DAMN

    2. To Pimp A Butterfly

    3. good kid, m.A.A.d city

  3. Spotify’s ratings of song danceability actually have an inverse correlation with Apple’s ranking of song popularity!

  4. There does not appear to be much of a correlation between Spotify’s rankings of song energy and song danceability

  5. Of his 3 most popular albums, To Pimp A Butterfly has the highest danceability per second, with an approximate 0.0035 average danceability per second.

01

Correlation of Song Popularity to Song Danceability

A scatterplot that plots every single Kendrick song based on its danceability and energy level, obtained with Spotify data. We found that overall the greater the value of Danceability, the less popular the song. 

02

Song Energy vs Danceability Level

A scatterplot that plots every single Kendrick song based on its danceability and energy level, obtained with Spotipy data.

03

Danceability Per Second of each Album

Plots a bar chart of average danceability per second (y-axis) for each album (x-axis)

04

Popularity of Each Album

A bar chart with each of Kendrick’s most popular albums, and graphs their total popularity of each song, gained by calculating the total popularity of each song in the top 50 most popular Kendrick songs. 

bottom of page