Songs to pave the seasons
Analysis of my Spotify data for the period 2016-2024.
Technical details
This is a suitable task for an array language, so I rely on BQN which is my favorite one:
⟨P⇐Parse⟩ ← •Import "../bqn-libs/json.bqn" @ ⊣ spd ← P •file.Chars "data.json"
Additional structural information is needed, namely index of the songs, artists, elapsed time, and the length of the desired result.
s‿a‿m‿l ← ⟨7, 8, 3, 1+↕20⟩
Define a (50 chars) dyadic block function to execute the queries:
Q ← {l≍˘∾(⍷𝕨⊸⊏˘)¨ l⊏ ((⍒(+´m⊸⊏˘)¨)⊸⊏ 𝕨⊸⊏˘⊐⊸⊔⊢) >1⊏¨ 𝕩}
Top songs
s Q spd
┌─ ╵ 1 "Countless Skies" 2 "Divertimento I, K.136: Allegro" 3 "The Numbers" 4 "Autre temps" 5 "Ghost of Perdition" 6 "Crossing the Road Material" 7 "Hoppípolla" 8 "Ether" 9 "Colossus" 10 "River" 11 "El Tete" 12 "Will o the Wisp" 13 "Pakumba" 14 "Damned Rope" 15 "Eternal Rains Will Come" 16 "La femme d'argent" 17 "Bajanda" 18 "Nimrodel - Medley" 19 "Breathe (In The Air) - 2011 Remastered Version" 20 "In The Shadow Of Our Pale Companion" ┘
Top artists
a Q spd
┌─ ╵ 1 "Opeth" 2 "Wolfgang Amadeus Mozart" 3 "Pink Floyd" 4 "Be'lakor" 5 "Sigur Rós" 6 "Coldplay" 7 "Mogwai" 8 "Chocolate Mc" 9 "Radiohead" 10 "Joaquín Sabina" 11 "Iron & Wine" 12 "Rammstein" 13 "Alcest" 14 "Buena Fe" 15 "Silvio Rodríguez" 16 "Amon Amarth" 17 "In Mourning" 18 "Lamb of God" 19 "Camel" 20 "Omnium Gatherum" ┘