-
Notifications
You must be signed in to change notification settings - Fork 9
/
analysing-the-muisc-i-listen-to.html
164 lines (149 loc) · 12.1 KB
/
analysing-the-muisc-i-listen-to.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0; URL='https://dvatvani.com/'" />
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,400italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="http://dvatvani.github.io/theme/stylesheet/style.min.css">
<link rel="stylesheet" type="text/css" href="http://dvatvani.github.io/theme/stylesheet/pygments.min.css">
<link rel="stylesheet" type="text/css" href="http://dvatvani.github.io/theme/stylesheet/font-awesome.min.css">
<link href="http://dvatvani.github.io/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="Dinesh Vatvani Atom">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="" />
<meta name="author" content="Dinesh Vatvani" />
<meta name="description" content="An analysis of my last fm data" />
<meta name="keywords" content="Python, Music, QS">
<meta property="og:site_name" content="Dinesh Vatvani"/>
<meta property="og:title" content="Analysing the music I listen to"/>
<meta property="og:description" content="An analysis of my last fm data"/>
<meta property="og:locale" content="en_US"/>
<meta property="og:url" content="http://dvatvani.github.io/analysing-the-muisc-i-listen-to.html"/>
<meta property="og:type" content="article"/>
<meta property="article:published_time" content="2017-04-18 01:15:00+01:00"/>
<meta property="article:modified_time" content=""/>
<meta property="article:author" content="http://dvatvani.github.io/author/dinesh-vatvani.html">
<meta property="article:section" content="Analysis"/>
<meta property="article:tag" content="Python"/>
<meta property="article:tag" content="Music"/>
<meta property="article:tag" content="QS"/>
<meta property="og:image" content="/static/Logo/radial_barh.png">
<title>Dinesh Vatvani – Analysing the music I listen to</title>
</head>
<body>
<aside>
<div>
<a href="http://dvatvani.github.io">
<img src="/static/Logo/radial_barh.png" alt="Dinesh Vatvani" title="Dinesh Vatvani">
</a>
<h1><a href="http://dvatvani.github.io">Dinesh Vatvani</a></h1>
<p>A Python and data analysis blog</p>
<nav>
<ul class="list">
<li><a href="http://dvatvani.github.io/pages/about.html#about">About</a></li>
</ul>
</nav>
<ul class="social">
<li><a class="sc-github-square" href="https://github.com/dvatvani" target="_blank"><i class="fa fa-github-square"></i></a></li>
<li><a class="sc-twitter-square" href="https://twitter.com/d_vatvani" target="_blank"><i class="fa fa-twitter-square"></i></a></li>
<li><a class="sc-rss-square" href="http://dvatvani.github.io/feeds/all.atom.xml" target="_blank"><i class="fa fa-rss-square"></i></a></li>
</ul>
</div>
</aside>
<main>
<nav>
<a href="http://dvatvani.github.io">Home</a>
<a href="/archives.html">Archives</a>
<a href="/categories.html">Categories</a>
<a href="/tags.html">Tags</a>
<a href="http://dvatvani.github.io/feeds/all.atom.xml">Atom</a>
</nav>
<article>
<header>
<h1 id="analysing-the-muisc-i-listen-to">Analysing the music I listen to</h1>
<p>Posted on Tue 18 April 2017 in <a href="http://dvatvani.github.io/category/analysis.html">Analysis</a></p>
</header>
<div>
<p>I’ve been tracking the music I listen to since 2012 through last.fm. They offer a free account and you can install “scrobbler” plugins on different systems used to listen to music to allow you to track the music you listen to. Spotify natively supports last.fm scrobbling too and there are scrobblers that work well with Android devices too (I suspect the same is also true for iOS, but I don’t have first hand experience of it). </p>
<p>Last.fm offer some <a href="https://www.last.fm/user/thehuntinghawk/listening-report/year">summary stats</a>, and they can be quite interesting to look at but I felt like a lot more could be done with the data collected, so I decided to analyse the data myself. </p>
<p>The data for the analysis was collected using the <a href="http://www.last.fm/api">last.fm <span class="caps">API</span></a> and analysed using Python in Jupyter Notebooks. The analysis is heavily inspired by <a href="http://geoffboeing.com/2016/05/analyzing-lastfm-history/">this blog post from Geoff Boeing</a>. In fact, a lot of the analysis builds on top of work he has done. The code used for the analysis can be found in the form of Jupyter notebooks over <a href="http://nbviewer.jupyter.org/github/dvatvani/dvatvani.github.io/tree/master/static/last-fm/">here</a>. The analysis can be easily run using your own last.fm data. All you need is an <span class="caps">API</span> key for last.fm. </p>
<p>The data analysed contains 13,446 scrobbles containing 3,908 unique tracks and 522 unique artists. The data analysed is mainly from last.fm, but some additional data about artists, albums and tracks was obtained from <a href="https://musicbrainz.org/">musicbrainz</a>.</p>
<p>Let’s start the analysis with some of the usual suspects… Here are the most played artists, albums and tracks in my music history.</p>
<p><img alt="top artists" src="http://dvatvani.github.io/static/last-fm/lastfm-artists-played-most-h.png" /></p>
<p><img alt="top albums" src="http://dvatvani.github.io/static/last-fm/lastfm-albums-played-most-h.png" /></p>
<p><img alt="top tracks" src="http://dvatvani.github.io/static/last-fm/lastfm-tracks-played-most-h.png" /></p>
<p>All of the above lists are indicative of my taste in music (or lack thereof, depending on your perspective!), but another interesting aspect to consider is the level of breadth of exploration for each artist i.e. how many unique different tracks from the artist I’ve listended to. </p>
<p><img alt="artist exploration breadth" src="http://dvatvani.github.io/static/last-fm/lastfm-uniqe-tracks-played-per-artist-most-h.png" /></p>
<p>The genre descriptions on last fm for the artists I listen to can also be a useful indicator of the genre distribution of the music I listen to.</p>
<p><img alt="genre distribution" src="http://dvatvani.github.io/static/last-fm/lastfm-genres.png" /></p>
<p>…as can the year of release of the tracks I listen to.</p>
<p><img alt="release year distribution" src="http://dvatvani.github.io/static/last-fm/lastfm-songs-release-year.png" /></p>
<p>This suggests that most of the music I listen to was made after I was born! It’s worth noting, however, that there the year of release is not available for all tracks in my music history. Some of the data is missing for the more recent years (which is why the plot stops at 2015) and some of the data is also missing for some older tracks in my music played dataset (e.g. The Who and The Beatles), so it is difficult to gauge just how skewed the music I listen to is to music made in the last 3 decades.</p>
<p>Most of the analysis above explores the music I tend to listen to but not how/when I tend to listen to it. I think a lot can be leart about oneself by examining behavioural patterns that aren’t often examined, so below is some examination of patterns in how I listen to music.</p>
<p>We can look at how the amount of music I listen to has evolved over time.</p>
<p><img alt="scrobbles timeseries" src="http://dvatvani.github.io/static/last-fm/lastfm-songs-played-timeseries.png" /></p>
<p>And look at relative play counts in a calendar view to obtain an intuitive sense for how much daily variation exists.</p>
<p><img alt="activity calendar" src="/static/last-fm/lastfm-activity-calendar-view.png" /></p>
<p>The breakdown of how much music I listen to by day of week and hour can also be very informative.</p>
<p><img alt="scrobbles by hour and day of week" src="http://dvatvani.github.io/static/last-fm/lastfm-scrobbles-days-hours.png" /></p>
<p><img alt="scrobbles by hour" src="http://dvatvani.github.io/static/last-fm/lastfm-scrobbles-per-hour.png" /></p>
<p><img alt="scrobbles by day of week" src="http://dvatvani.github.io/static/last-fm/lastfm-scrobbles-per-weekday.png" /></p>
<p>There’s aspects of my lifestyle visible in the plots above. I listen to music a lot around 10 am on weekdays (on my commute to work) and have a fairly erratic sleeping pattern. There isn’t a day of week and time of day during which I haven’t, at some point, been listening to music!</p>
<p>Observing patterns in when I listen to new artists can also be insightful…</p>
<p><img alt="new artist and track timeseries" src="http://dvatvani.github.io/static/last-fm/lastfm-new-artists-and-tracks-timeseries.png" /></p>
<p>…as can observing when I listen to my most played artists.</p>
<p><img alt="timeseries for top artists" src="http://dvatvani.github.io/static/last-fm/lastfm-scrobbles-top-artists-years.png" /></p>
<p>I’m clearly prone to binge listening to my favourite artists. I can listen to 300 or 400 songs from a single band in a span of a couple of weeks. Given the nature of music and how it’s released in albums, it lends itself naturally to music from a given artist being heard in groups of around 12-15 tracks, but my music history suggests that I have a habit of binge listening to artists beyond the scope of what can be reasonably explained by listening to one or even two albums from the band in a couple of weeks.</p>
<p>There’s a lot more that can be done with this data, and I may return to it in the future, but I’ve found analysing my music listnening history very interesting and more insightful than I was expecting. </p>
<p><em>If you have any other ideas about what might be interesting to do with this dataset, let me know in the comments. The Jupyter notebook that was used to generate all the plots in this blog post can be found <a href="http://nbviewer.jupyter.org/github/dvatvani/dvatvani.github.io/tree/master/static/last-fm/">here</a>.</em></p>
</div>
<div class="tag-cloud">
<p>
<a href="http://dvatvani.github.io/tag/python.html">Python</a>
<a href="http://dvatvani.github.io/tag/music.html">Music</a>
<a href="http://dvatvani.github.io/tag/qs.html">QS</a>
</p>
</div>
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = 'dvatvani';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
</article>
<footer>
<p>© Dinesh Vatvani </p>
<p>Built using <a href="http://getpelican.com" target="_blank">Pelican</a> - <a href="https://github.com/alexandrevicenzi/flex" target="_blank">Flex</a> theme by <a href="http://alexandrevicenzi.com" target="_blank">Alexandre Vicenzi</a></p> </footer>
</main>
<!-- Google Analytics -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-75651339-1', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"name": "Analysing the music I listen to",
"headline": "Analysing the music I listen to",
"datePublished": "2017-04-18 01:15:00+01:00",
"dateModified": "",
"author": {
"@type": "Person",
"name": "Dinesh Vatvani",
"url": "http://dvatvani.github.io/author/dinesh-vatvani.html"
},
"image": "/static/Logo/radial_barh.png",
"url": "http://dvatvani.github.io/analysing-the-muisc-i-listen-to.html",
"description": "An analysis of my last fm data"
}
</script></body>
</html>