Public
Edited
Nov 21, 2022
Insert cell
Insert cell
raw_data = [
{
year: new Date("2016"),
first_day_attendance: 283041,
twentieth_day_attendance: null,
first_day_percentage: 0.939
},
{
year: new Date("2017"),
first_day_attendance: 276444,
twentieth_day_attendance: null,
first_day_percentage: 0.947
},
{
year: new Date("2018"),
first_day_attendance: 268406,
twentieth_day_attendance: null,
first_day_percentage: 0.945
},
{
year: new Date("2019"),
first_day_attendance: 266238,
twentieth_day_attendance: null,
first_day_percentage: 0.941
},
{
year: new Date("2020"),
first_day_attendance: 233828,
twentieth_day_attendance: null,
first_day_percentage: 0.842
},
{
year: new Date("2021"),
first_day_attendance: 242579,
twentieth_day_attendance: 260145,
first_day_percentage: 0.912
}
]
Insert cell
data = raw_data.map((d) => ({
...d,
denominator: d.first_day_attendance / d.first_day_percentage
}))
Insert cell
data
Type Table, then Shift-Enter. Ctrl-space for more options.

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