spotify_percentages = {
let totalSpotify = tidy(
data,
select(["artist", "spotify_monthly"]),
summarize({perc: sum("spotify_monthly")})
)[0].perc
return tidy(
data,
select(["artist", "spotify_monthly"]),
mutate({perc: d => d.spotify_monthly / totalSpotify * 100})
)
}