Public
Edited
Jun 3, 2023
Insert cell
Insert cell
funcionarios = d3.tsv(
"https://raw.githubusercontent.com/aaizemberg/vis/gh-pages/dpa/funcionarios_caba.tsv"
)
Insert cell
Select a data source…
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
Select a data source…
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
funcionarios
select sexo, count(*) from funcionarios group by sexo
Insert cell
airbnb_listings = d3.csv(
"https://raw.githubusercontent.com/aaizemberg/vis/gh-pages/dpa/tmp/listings.csv",
d3.autoType
)
Insert cell
HR_comma_sep.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
hr
select salary, "left", count(*)
from hr
group by salary, "left"
-- 0 (se quedaron)
-- 1 (se fueron)
Insert cell
airbnb_listings
-- SELECT count(*), min(price), max(price), avg(price), median(price) FROM airbnb_listings
-- SELECT count(distinct price) FROM airbnb_listings
SELECT neighbourhood, room_type, count(*) as cant
FROM airbnb_listings
where price < ${range}*250
group by neighbourhood, room_type
order by 1,2 desc

Insert cell
Insert cell
Plot.plot({
marginLeft: 100,
color: {
scheme: "YlGnBu",
type: "symlog"
},
marks: [
Plot.cell(nrc, {
x: (d) => d.room_type,
y: (d) => d.neighbourhood,
fill: "cant"
}),
Plot.text(nrc, {
x: (d) => d.room_type,
y: (d) => d.neighbourhood,
text: "cant"
})
]
})
Insert cell
airbnb_listings
SELECT DISTINCT room_type FROM airbnb_listings
Insert cell
Plot.plot({
marks: [
Plot.rectY(resultado, Plot.binX({ y: "count" }, { x: "dolares" })),
Plot.ruleY([0])
]
})
Insert cell
airbnb_listings
select neighbourhood, sum(price), count(*)
from airbnb_listings
WHERE price > 1000*250
group by neighbourhood
HAVING sum(price) > 10000000
order by 2 desc
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