Public
Edited
Feb 3, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
ds = JSONstat(jsonURL, Float32Array)
Insert cell
Insert cell
ds.value
Insert cell
Insert cell
ds.Dice({ area: ["CA"] }, { clone: true }).value
Insert cell
Insert cell
Insert cell
Insert cell
ds.toTable({ type: "arrobj" })
Insert cell
Insert cell
ds.toTable({ type: "objarr", status: true })
Insert cell
Insert cell
Insert cell
Insert cell
arrow = require("apache-arrow@4.0.0")
Insert cell
Insert cell
Insert cell
Insert cell
df = arrow.Table.from(fetch(arrowURL))
Insert cell
Insert cell
df.length
Insert cell
Insert cell
df.schema.fields
Insert cell
Insert cell
ca10 = df.filter(
arrow.predicate
.col("area")
.eq("CA")
.and(arrow.predicate.col("year").lt("2010"))
)
Insert cell
Insert cell
ca10.count()
Insert cell
Insert cell
Insert cell
Insert cell
tbl = aq.loadArrow(arrowURL)
Insert cell
tbl.view()
Insert cell
Insert cell
tbl
.filter((d) => d.year > "2002" && d.year < "2014")
.groupby("area")
.rollup({
mean: (d) => op.mean(d.value),
max: (d) => op.max(d.value),
min: (d) => op.min(d.value)
})
.filter((d) => d.mean > 10)
.orderby(aq.desc("mean"))
.view()
Insert cell
Insert cell
arrobj = tbl.objects()
Insert cell
Insert cell
Insert cell
ds2 = fromTable(arrobj, {
type: "arrobj",
vlabel: "value",
slabel: "status",
ostatus: true,
instance: true
})
Insert cell
Insert cell
ds.Data({ area: "UK", year: "2010" }).value
Insert cell
Insert cell
ds2.Data({ area: "UK", year: "2010" }).value
Insert cell
Insert cell
tbl.filter((d) => d.area === "UK" && d.year === "2010").values("value")
Insert cell
Insert cell
aq.table(ds.toTable({ type: "objarr", content: "id", status: true })).view()
Insert cell
Insert cell
aq.toArrow(ds.toTable({ type: "arrobj", content: "id", status: true }))
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