Public
Edited
Feb 7, 2024
Insert cell
Insert cell
import { aq, op } from "@uwdata/arquero"

Insert cell
d3 = require("d3@7")
Insert cell
dt2 = dt
.select(0, aq.range(4, 39))
.fold(aq.not("GID"))
.derive({
rate: (d) => op.parse_float(op.substring(d.key, 1)),
nutrient: (d) => op.substring(d.key, 0, 1)
})
.select(aq.not("key"))
.filter((d) => !op.is_nan(d.value))
.filter((d) => (d.nutrient == "G") & (d.rate == 0.1))
Insert cell
dt2.rollup({ a: (d) => op.sum(op.is_nan(d.value)) }).view()
Insert cell
op.parse_float(op.substring("A20asljfals", 1))
Insert cell
viewof dt = aq
.fromCSV(await FileAttachment("raw.csv").text())
.view({ height: 200 })
Insert cell
dat = d3.csvParse(await FileAttachment("raw.csv").text(), d3.autoType)
Insert cell
dat_table = aq.from(dat)
Insert cell
dat_table.select("rate", "G", "N").filter((d) => d.rate < 0.1)
Insert cell
dat_table.view()
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