Public
Edited
Nov 27, 2023
3 forks
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof data = aq
.fromCSV(await FileAttachment("data_by_artist.csv").text())
.view(10)
Insert cell
Insert cell
Insert cell
data
.orderby('danceability')
.view(10)
Insert cell
Insert cell
data
.orderby(aq.desc('danceability'))
.view(10)
Insert cell
Insert cell
Insert cell
data.orderby(aq.desc("danceability")).select("artists", "danceability").view(15)
Insert cell
Insert cell
data.orderby(aq.desc("danceability")).select(3, 4).view(5)
Insert cell
Insert cell
data
.orderby(aq.desc('danceability'))
.select(aq.not('mode'))
.view(5)
Insert cell
Insert cell
Insert cell
atanew = data
.filter((d) => op.includes(d.artists, "Beatles"))
.orderby(aq.desc("danceability"))
.select("artists", "danceability")
.view()
Insert cell
Insert cell
Insert cell
data
.derive({
dancing_vocals: (d) => 0.8 * d.danceability + 0.2 * d.instrumentalness
})
.orderby(aq.desc("dancing_vocals"))
.select(3, 4, 7, 15)
.view(10)
Insert cell
Insert cell
data
.groupby("key")
.rollup({
mean_d: (d) => op.mean(d.danceability),
mean_i: (d) => op.mean(d.instrumentalness),
mean_i_d: (d) => op.mean(0.8 * d.danceability + 0.8 * d.instrumentalness),
count: op.count()
})
.filter((d) => d.count > 200)
.orderby(aq.desc("count"))
.view(12)
Insert cell
data
.groupby('key')
.count()
.view(5)
Insert cell
Insert cell
Insert cell
viewof data2 = data
.fold(['acousticness', 'danceability', 'energy', 'tempo', 'instrumentalness', 'loudness', 'duration_ms', 'liveness', 'speechiness','popularity', 'valence'], {as: ['attributes', 'values'] })
.view(20)
Insert cell
viewof data3 = data
.fold(aq.range('acousticness','popularity'), {as: ['attributes', 'values'] })
.view(5)
Insert cell
data2
.groupby('attributes')
.count()
.orderby('attributes')
.view(10)
Insert cell
data2.groupby("artists").pivot("attributes", "values").view(5)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more