Public
Edited
Jan 22, 2024
1 star
Insert cell
Insert cell
Insert cell
Insert cell
data_wide = d3.tsv(
"https://aaizemberg.github.io/infovis/data/argentina_1869-2020.tsv",
d3.autoType
)
Insert cell
Wrangler(data_wide)
Insert cell
// reshape: wide --> long
//
data_long = aq
.from(data_wide)
.fold([
"1869",
"1895",
"1914",
"1947",
"1960",
"1970",
"1980",
"1991",
"2001",
"2010",
"2020"
])
.rename({ key: "Año" })
.rename({ value: "Poblacion" })
.objects()
Insert cell
Inputs.table(data_long)
Insert cell
// select y rename con arquero
aq
.from(data_wide)
.select("Provincia", "2020")
.rename({ 2020: "Poblacion" })
.objects()
Insert cell
data = // select y rename con vanilla js
data_wide.map((d) => ({ Provincia: d.Provincia, Poblacion: d["2020"] }))
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