Public
Edited
Jun 26, 2024
Paused
UVM course offering by department
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
db = DuckDBClient.of({
dept_count: FileAttachment("dept_count@1.csv"),
})
Insert cell
d = db.query(`
WITH top_10 as (
SELECT subj, SUM(n) as total
FROM dept_count
GROUP BY subj
ORDER BY SUM(n) DESC
LIMIT 10
)

SELECT subj, year, n
FROM dept_count
WHERE subj IN (SELECT subj FROM top_10);
`)
Insert cell
d2 = db.query(`
SELECT subj, SUM(n) as nb_courses
FROM dept_count
GROUP BY subj;
`)
Insert cell
dd = {
return select.length == 0 ?
null :
db.query(`
SELECT subj, year, n
FROM dept_count
WHERE subj IN (${select.map(d => '\''+d.subj+'\'').join()});
`)
}
Insert cell
fields = d2.map(d => d.subj)
Insert cell
foo = d2.map(d => d.nb_courses[0])
Insert cell
foo
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