Public
Edited
Jun 5
1 fork
Insert cell
Insert cell
Insert cell
life_expectancy = FileAttachment("life_expectancy.csv").zip()
Insert cell
lifeData = FileAttachment("life_expectancy.csv").csv()
Insert cell
tidyData = lifeData.flatMap(d =>
Object.entries(d)
.filter(([key, value]) => /^\d{4}$/.test(key))
.map(([year, value]) => ({
Country: d["Country Name"],
Year: +year,
LifeExpectancy: +value
}))
).filter(d => !isNaN(d.LifeExpectancy))
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