Public
Edited
May 1
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof job_indicators_data = aq
.fromCSV(await FileAttachment("processed_job_indicators_data.csv").text())
.view(10)
Insert cell
viewof job_indicators_data_v1 = job_indicators_data.select(
{'country_name': 'country'},
{'subsample': 'subsample' },
{'income_level_name': 'income_level'},
{'year_of_survey': 'year_of_survey'},
{'youth_aged_15_24': 'share_of_youth_population'},
{'not_in_labor_force_or_education_rate_among_youth_aged_15_24': 'youth_not_in_labor_force_or_education'},
{'youth_employment_rate_aged_15_24': 'youth_employment_rate'},
{'youth_unemployment_rate_aged_15_24': 'youth_unemployment_rate'},
{'labor_force_aged_15_64': 'labor_force'},
{'unemployment_rate_aged_15_64': 'unemployment_rate_aged'},
{'youth_non_agricultural_wage_employment_aged_15_24': 'youth_non_agricultural_wage_employment'},
)
.view()
Insert cell
job_indicators_data_v12 =job_indicators_data_v1.objects()
Insert cell
job_indicators_data_v22 =job_indicators_data_v12.filter(d => d.income_level === selected_data_radio);
Insert cell
job_indicators_data_v23 = aq.from(job_indicators_data_v22)
Insert cell
viewof job_indicators_data_v2 = job_indicators_data_v23
.filter(d => d.year_of_survey >= "2010")
.filter(d => d.subsample == "Male" || d.subsample == "Female" || d.subsample == "Low Education" || d.subsample == "High Education" || d.subsample == "All")
.view()
Insert cell
Insert cell
viewof scatter_data = job_indicators_data_v2
.filter(d => d.subsample == "High Education" || d.subsample == "Low Education")
.derive({
year_of_survey: aq.escape(d => new Date(d.year_of_survey, 0, 1)),
youth_employment_rate: aq.escape(d =>
Math.round(d.youth_employment_rate * 100) / 100),
share_of_youth_population: aq.escape(d =>
Math.round(d.share_of_youth_population * 10000)/10000)
})
.select(['country','year_of_survey','income_level', 'subsample','share_of_youth_population','youth_employment_rate'])
.view()
Insert cell
Insert cell
viewof layered_line_data = job_indicators_data_v2
.filter(d => d.subsample === "Low Education" || d.subsample === "High Education" && d.youth_non_agricultural_wage_employment != null)
.derive({
year_of_survey: aq.escape(d => new Date(d.year_of_survey, 0, 1)),
})
.groupby("year_of_survey", "income_level", "subsample")
.rollup({
avg_wage_employment: d => Math.round(op.mean(d.youth_non_agricultural_wage_employment) * 100) / 100
})
.orderby("year_of_survey")
.view()

Insert cell
Insert cell
viewof histogram_data = job_indicators_data_v2
.filter(d => d.subsample == "All")
.derive({
year_of_survey: aq.escape(d => new Date(d.year_of_survey, 0, 1)),
youth_unemployment_rate: aq.escape(d =>
Math.round(d.youth_unemployment_rate * 100) / 100),
})
.select(['year_of_survey', 'country', 'subsample','youth_unemployment_rate'])
.view()
Insert cell
Insert cell
viewof h_bar_chart_data = job_indicators_data_v2
.filter(d => d.subsample != "All" && d.subsample != "Male" && d.subsample != "Female")
.derive({
year_of_survey: aq.escape(d => new Date(d.year_of_survey, 0, 1))
})
.groupby("year_of_survey", "subsample")
.rollup({
mean_not_in_labor_force: d => Math.round(op.mean(d.youth_not_in_labor_force_or_education) * 100) / 100
})
.select(["year_of_survey", "subsample", "mean_not_in_labor_force"])
.view()
Insert cell
Insert cell
import { aq, op } from "@uwdata/arquero"
Insert cell
import { vl } from "@vega/vega-lite-api-v5"
Insert cell
import {Select} from "@observablehq/inputs"
Insert cell
import { Inputs } from "@observablehq/inputs";
Insert cell
import {checkbox} from "@jashkenas/inputs"
Insert cell
import {radio} from "@jashkenas/inputs"
Insert cell
d3 = require("d3@6")
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