Published
Edited
Jan 19, 2022
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import { aq, op } from "@uwdata/arquero"
Insert cell
aq
.from(data)
.groupby("dem_school_type_by_age_range")
.count()
.derive({
percent: (d) => (100 * d.count) / op.sum(d.count)
})
.view() // to see in Observable as a nice table
Insert cell
Insert cell
d3.groups(data, (d) => d.dem_school_type_by_age_range)
Insert cell
Insert cell
d3.rollups(
data,
(arr) => arr.length,
(d) => d.dem_school_type_by_age_range
)
Insert cell
Insert cell
d3
.rollups(
data,
(arr) => arr.length,
(d) => d.dem_school_type_by_age_range
)
.map((d, i, arr) => [d[0], (100 * d[1]) / d3.sum(arr, (d) => d[1])])
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