Public
Edited
Feb 22, 2023
Insert cell
Insert cell
url = FileAttachment("data.csv").url()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
x = d3.scaleLinear()
.domain([d3.min(data_set, d => d.basePay) - 10_000, d3.max(data_set, d => d.basePay) + 10_000])
.range([20, width - 20])
Insert cell
d3.group(data_set, d => d.jobTitle)
Insert cell
gby_jobTitle_mean = d3.rollup(data_set, v => d3.mean(v, v=> v.basePay), d => d.jobTitle)
Insert cell
Insert cell
Insert cell
Insert cell
data_set_no_outliers = d3.filter(data_set, d => lower_0_05 < d.basePay && d.basePay < higest_0_95)
Insert cell
data_no_out_gby_base_pay_count = d3.rollup(data_set_no_outliers, v => v, d => d.basePay)
Insert cell
// Plot.plot({
// marks: [
// Plot.rectY(data_set_no_outliers, Plot.bin({y: 'count'}, {x: 'key'})).plot()
// ]
// })
Plot.rectY(data_set_no_outliers, Plot.bin({y: 'count'}, {x: 'basePay'})).plot()
Insert cell
Insert cell
list_data_set_no_outliers
Type Table, then Shift-Enter. Ctrl-space for more options.

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