Changes again

This commit is contained in:
Andras Schmelczer 2026-03-15 21:14:50 +00:00
parent f4de0eeb9f
commit 479ef92236
4 changed files with 160 additions and 95 deletions

View file

@ -538,6 +538,21 @@ impl PropertyData {
Ok(joined)
};
let listings_buy = load_listings(listings_buy_path, "buy")?;
// Derive "Asking price per sqm" if not already present
let listings_buy = if listings_buy.schema().get("Asking price per sqm").is_none() {
listings_buy
.lazy()
.with_column(
(col("Asking price").cast(DataType::Float64)
/ col("Total floor area (sqm)"))
.round(0)
.alias("Asking price per sqm"),
)
.collect()
.context("Failed to derive Asking price per sqm")?
} else {
listings_buy
};
let listings_rent = load_listings(listings_rent_path, "rent")?;
// Concatenate all rows into a single DataFrame