monthly1bd = FileAttachment("1bd-by-month@42.tsv")
.tsv()
.then((data) => {
const formatMonth = d3.utcFormat("%b");
return data.map((row) => ({
date: new Date("" + row.year + "-" + row.month + "-01"),
origMonth: row.month,
initialRentNominal: row.medianInitialRent,
initialRentReal:
(row.medianInitialRent /
cpi.filter((c) => c.Year == +row.year)[0][
formatMonth(new Date("" + row.year + "-" + row.month + "-01"))
]) *
319.615,
count: row.count
}));
})