Public
Edited
Dec 20, 2022
Insert cell
Insert cell
dahlem_precipitation = {
const input = await FileAttachment("produkt_nieder_jahr_19500101_20211231_00403.txt").text()
return aq.fromCSV(input, {delimiter: ';'}).view()
}
Insert cell
dahlem_climate = {
const input = await FileAttachment("produkt_klima_jahr_17190101_20211231_00403.txt").text()
return aq.fromCSV(input, {delimiter: ';'})
}
Insert cell
viewof source = dahlem_climate
.derive({ year: d => +op.substring(d.MESS_DATUM_BEGINN, 0, 4) })
.select({ year: 'year', JA_RR: 'precipitation', JA_TT: 'temperature' })
.filter(d => d.precipitation >= 0 && d.temperature >= 0)
.derive({ temperature_mean: d => op.mean(d.temperature) })
.derive({ precipitation_mean: d => op.mean(d.temperature) })
.view()
Insert cell
Insert cell
Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.lineY(source, Plot.windowY({x: "year", y: "temperature", k: 10, reduce: "mean"}))
]
})
Insert cell
Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.lineY(source, {x: "year", y: "precipitation"})
]
})
Insert cell
Plot.plot({
marks: [
Plot.ruleY([0]),
Plot.lineY(source, Plot.windowY({x: "year", y: "precipitation", k: 10, reduce: "mean"}))
]
})
Insert cell
import { aq, op } from '@uwdata/arquero'
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