Public
Edited
Nov 18, 2022
Insert cell
Insert cell
data = [
{ bottle: "b1", no: 1, psu: 33.9553 },
{ bottle: "b1", no: 2, psu: 33.9523 },
{ bottle: "b1", no: 3, psu: 33.9549 },
{ bottle: "b1", no: 4, psu: 33.9552 },
{ bottle: "b1", no: 5, psu: 33.9551 },
{ bottle: "b2", no: 1, psu: 33.9578 },
{ bottle: "b2", no: 2, psu: 33.9562 },
{ bottle: "b2", no: 3, psu: 33.9573 },
{ bottle: "b2", no: 4, psu: 33.9561 },
{ bottle: "b2", no: 5, psu: 33.9569 }
]
Insert cell
Insert cell
Insert cell
{
const g1 = d3.groups(data, (d) => d.bottle).map((d) => d[1]);
return g1.map((d) => d3.mean(d, (v) => v.psu));
}
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