Public
Edited
Jul 31, 2022
1 fork
Insert cell
Insert cell
input_data = {
const fileBuffer = await FileAttachment('61511-01-03-4_flat(3).csv').arrayBuffer()
const windows1252 = new TextDecoder('windows-1252')
const text = windows1252.decode(fileBuffer) // Source file is encoded using ISO 8859-1 / Windows-1252
return aq.fromCSV(text, {delimiter: ';'}) // Source file uses semicolons as delimiters
}
Insert cell
Insert cell
table = input_data
.filter(d => d['2_Auspraegung_Label'] === 'Insgesamt')
.select('1_Auspraegung_Label', 'Zeit', 'BAU004__Durchschnittlicher_Kaufwert_je_qm__EUR')
.derive({ value: d => +op.replace(d['BAU004__Durchschnittlicher_Kaufwert_je_qm__EUR'], ',', '.') })
Insert cell
Insert cell
Insert cell
Insert cell
[...pivoted_table]
Insert cell
vegalite({
data: {values: [...table]},
mark: "line",
encoding: {
x: {field: "Zeit"},
y: {field: "value", type: "quantitative"},
color: {field: "1_Auspraegung_Label", type: "nominal"}
// " Berlin", type: "quantitative"
// region names contain trailing white space 😞
}
})
Insert cell
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