It’s the summer of Tableau’s Data+Music campaign. We’ve also announced that the latest Iron Viz feeder is about music data. Perhaps one or both of these will inspire you to analyse your own music listening habits?
It’s a path worth following as there’s so much to discover. For example, this year I’ve listened to The Comet is Coming more than any other band (191 tracks so far). They’re a jazz/electronica/psychedelic rock band from London. Check ’em out.
I’ve also built a viz that lets me find bands I’ve stopped listening to: it’s great way to reacquaint with old favourites. Come back next week for that post.
I’m going to post a series of posts about my last 10 years of digital music data.
First of all, we need some data. In this first post, I’ll explain how I got the data. To analyse your music, the steps are as follows:
- Setup a last.fm account
- Enable “scrobbling” to your digital music services so that last.fm can track your music.
- Download your last.fm data to a CSV
- Analyse it in Tableau Desktop or Tableau Public
If you don’t want to start scrobbling to last.fm, I also explain at the end of this post how to get 4 months of data from Spotify.
Setup a last.fm account
I’ve been scrobbling data to last.fm since 2007. You can see my profile here. Once your music services are setup, every track you listen to will be recorded on last.fm.
Don’t be disheartened if you’re only just starting: even 1 month’s music data is interesting. And if you start now, before you know it, you’ll have a year of data to look at.
Export your data to a CSV
Once you’ve got a few weeks of data together, it’s time to analyse it. You can go down a complex route and write your own API script. Or you can use my friend Ben’s LastFmToCSV converter. Simply pop in your username (or anyone else’s username, for that matter), and it’ll create a CSV for you.
Connect Tableau to the CSV
Open Tableau Desktop and connect to the CSV. You’ll see that there are no column headers in the file. To rename each column, double click on the F1, F2, headers and type in the correct name. See below:
Discover your music listening habits!
You’re all set to explore away! The dataset only has 4 dimensions and one measure. With some nifty calculations, though, you could be asking all sorts of interesting questions, such as “How many new bands do I listen to each year?”
It looks like my peak for new bands was 2016, when I listened to 1,429 new bands. Last year it was only 909: as I get older, might it be that I’m happier sticking to music I know?
This is great. Where’s an example workbook?
I’ve created a super-basic workbook you can download here. That will get you going. But I know you want more!
Over the next week or so I’ll be writing more posts sharing the types of questions I’ve been able to answer with this dataset. To download that, more complex workbook, click here.
I’m impatient: I want some music history data NOW: can I get my Spotify data?
Ok, I hear you! You want data right now. And what’s that? You’re a Spotify account holder? You want your Spotify data right away? If you can wait 3 days, I have a solution which doesn’t use Last.Fm. You can download 3 months of listening data right from Spotify!
If you go to your Spotify Account’s Privacy page there is an option to download your data.
This will download pretty much the same data you get from last.fm. In my experience, you have to wait 1 or 2 days to get the data, but it’s an easy method. Unfortunately, it’s only 3 months of data though. It’s not feasible to build a long-term dataset this way, so I stick to scrobbling to last.fm.
[Sidenote: Using GDPR laws, I sent Spotify a Subject Access Request for ALL my data, but instead of a tracklist, you get 250MB of JSON data with literally every interaction you’ve ever had with Spotify! It was too much to take in!]
Ok – you are all set to start collecting and analysing your data.
In the next few posts, I’ll look at;
- my top 10 artists, tracks, years.
- New music
- Artists that I no longer listen to
- Binge listening
Let me know your thoughts in the comments below, or on twitter (@acotgreave).
And now, I’m off to listen to my most listened to track of all time. Depressingly, it’s Let it Go from Frozen (ninety-six times!). Come on everyone, join me in a sing-a-long. “The snow glows white on the mountain tonight…”