Published
Edited
Dec 13, 2020
2 stars
Insert cell
Insert cell
viewof data = aq
.fromCSV(await FileAttachment('w59.csv').text())
.view(5)
Insert cell
Insert cell
data.groupby('POL1DT_W59').count().view()
Insert cell
data.groupby('POL1DT_W59')
.rollup({
pol1dt_weighted: d => op.sum(d.WEIGHT_W59)
})
.view()
Insert cell
Insert cell
data.groupby('POL1DT_W59').count()
.derive({ percent: d => d.count / op.sum(d.count) })
.select(aq.not('count'))
.view()
Insert cell
data.groupby('POL1DT_W59')
.rollup({
pol1dt_weighted: d => op.sum(d.WEIGHT_W59)
})
.ungroup()
.derive({
percent: d => d.pol1dt_weighted / op.sum(d.pol1dt_weighted)
})
.select(aq.not('pol1dt_weighted'))
.view()
Insert cell
Insert cell
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