Exploring My Spotify Listening
October 3, 2020.
I have been using Spotify for two years now. I was always curious to know my listening trends, which is why I started using last.fm and other tools like that. However, they didn’t give me exact information as to what I listened – the insights Spotify gave me were limited to what Spotify thought! I couldn’t know more about which artists I listened to, what were the top songs from that artist and so on.
Therefore, I looked up for my listening data on Spotify (thank you, GDPR!) and then made some nice plots for inferences.
Getting your streaming history
Spotify allows you to download all your data through its accounts webpage (https://www.spotify.com/us/account/privacy/).
Then, you need to request for all your data. This step will take something between a day or a fortnight depending how much you listen. For me, it took two working days and I got two files on streaming. Again, for heavy listeners, there will be more files.
Implementing in R
First, we will load the streaming history files in R. If there are multiple files, read them all one by one like I’ve done here. Finally, combine all of them together. Don’t forget to remove the ones you don’t need – it takes a lot of run-time memory.
To find out which artists I listen to most, let me make a visualisation for the same.
count(artistName, sort = TRUE) is going to count all the artists as their total count is going to tell me how many I listen to.
top_n(15) is going to give me top 15 entries.
mutate(artistName = reorder(artistName, n)) will reorder the tibble, sorted by their counts.
geom_bar() is used for barplots, scale_fill_distiller() is used for colourful and continuous scale. Rest functions are for cosmetic reasons.
As you can observe, I listened most to Arijit Singh, Pritam and AR Rahman. The top non-Indian artist here is Post Malone and Billie Ellish – and only two in top 15. This is not surprising as I mostly like Bollywood artists as they mix classical and pop really well.
Again, I will make a visualisation and use it for inference. The functions and explanations are the same as in artists.
In contrast to my top artists, far more non-bollywood songs feature in my top tracks. In fact, three out of top-five tracks are non-Indian.
Its probably because I mostly listen to bollywood and a select few from other genres; but when I do listen other genres, I quickly grow to love them.
Tracks by Artists
Considering my listening history of artists and tracks give two different pictures, let me see which songs do I really listen to by my top artists.
One line needs to be added for selecting the artists: filter(artistName == "Ritviz") before count() and after st.
Below is an image carousel for eight different artists from my top 10. Click on next arrow to see the next plot.
Time of Listening
Finally, I want to what time of the day I listen to most. Now, I could’ve made a barplot but then I remembered of a neat “clock plot” I saw once on Reddit (r/dataisbeautiful). I wanted to replicate it with my own Spotify history.
First, I will take end times in a separate data frame for further use. I’ll reformat it in date-time format using as.POSIXct(), and change the time zone to India’s Asia/Kolkata.
Then, I’ll add additional columns in the dataframe for hour, minute and seconds of time when I finished listening.
Then, I’ll modify the data frame and make it into a count-table by hours.
Finally, I’ll make the clock plot. I use coord_polar() to convert into polar coordinates. The theme() is used for cosmetic reasons.
When do I listen to Music?
So, I listen most in the morning between 8 AM and 12 PM. As the day proceeds, my listening also falls, virtually stopping in the afternoon. It picks up again in the evening and stays at a relatively constant level till around 10 PM.
Did you like this small exploration? Why don't you try your own and see what you find for your own music!
P.S. Please feel free to contact me if you encounter any errors. My email: email@example.com