Public
Edited
Oct 13, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
laposte_hexasmal = aq.fromCSV(await FileAttachment("laposte_hexasmal.csv").text(), {delimiter: ";"})
Insert cell
latlong = laposte_hexasmal
.select({
Code_commune_INSEE: "insee",
// Nom_commune: "nom",
coordonnees_gps: "gps"
})
.dedupe()
.spread({gps: d => aq.op.split(d.gps, ',')}, {as: ["lat", "long"]})
Insert cell
Insert cell
Insert cell
Insert cell
insee_communes_2019 = aq.fromCSV(await FileAttachment("INSEE_communes_2019.csv").text(), {delimiter: ";", autoType: false})
Insert cell
communes = insee_communes_2019
.select({
CODREG: 'id_region',
REG: 'region',
CODDEP: 'id_dpt',
CODCOM: 'id_com',
COM: 'nom',
PTOT: 'pop2019'
})
.derive({insee: d => d.id_dpt + d.id_com})
.join_left(latlong, 'insee')
.derive({
pop2019: d => +d.pop2019,
lat: d => +d.lat,
long: d => +d.long
})
.orderby('lat')
.filter(d => d.lat > 40) // France métropolitaine seulement
Insert cell
Insert cell
Insert cell
Insert cell
villes_autres = [
"59107", // Bray-Dunes
"59183", // Dunkerque
"2B033", // Bastia
"2A041", // Bonifacio
]
Insert cell
villes = communes
.filter(d => d.pop2019 >= 50000)
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