Public
Edited
Feb 11
16 forks
Importers
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = aq.fromCSV(await FileAttachment("data_by_genres.csv").text())
Insert cell
Insert cell
Insert cell
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("genres", "danceability")
.view(10)
Insert cell
Insert cell
data
.orderby(aq.desc("danceability"))
.select(1, 3)
.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.genres, "salsa"))
.orderby(aq.desc("danceability"))
.select("genres", "danceability")
.view(5)
Insert cell
Insert cell
Insert cell
data
.derive({
dancing_vocals: (d) => 0.5 * d.danceability + 0.5 * d.instrumentalness
})
.orderby(aq.desc("dancing_vocals"))
.select(1, 3, 6, 14)
.view(10)
Insert cell
data
.derive({ electro: (d) => op.includes(d.genres, "electro") })
.orderby(aq.desc("electro"))
.select(1, 3, 6, 14)
.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.2 * d.instrumentalness),
count: op.count()
})
.select(0, 1, 2, 3)
.orderby("mean_d")
.view(12)
Insert cell
data.groupby("key").count().view(12)
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('genres')
.pivot('attributes', 'values')
.view(5)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { aq, op } from '@uwdata/arquero'
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