Published
Edited
Mar 14, 2018
Insert cell
Insert cell
Insert cell
parsed = data.split('\n').map(r => r.split(/, */g))
Insert cell
Insert cell
nested = d3.nestBy(parsed, d => d[0]).map(r => [r.key].concat(r.map(d => d[1])))
Insert cell
Insert cell
result = nested.map(r => r.join(', ')).join('\n')
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