Public
Edited
Dec 12, 2022
Insert cell
Insert cell
gas.slice(800, 900)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
electricityPerWeek = electricity.filter((row) => getWeek(row) === week)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function getWeek(row) {
const year = new Date(row.date.getFullYear(), 0, 1);
const days = Math.floor((row.date - year) / (24 * 60 * 60 * 1000));
const week = Math.ceil((row.date.getDay() + 1 + days) / 7);
return week;
}
Insert cell
Insert cell
function* electricityCombineAndFormat(csvs) {
for (let csv of csvs) {
for (let row of csv) {
const cumulative = parseFloat(row.Elec_levering_Wh) / 1000;

yield {
date: parseDate(row.Datum),
cumulative
};
}
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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