spb/wp10_uqo Public
UQO Working Paper No. 10 — The assessment gap in Quebec: vertical and horizontal inequity in municipal property assessment.
TeX 55.9%
Python 44%
1#!/usr/bin/env python32# Author: Simon-Pierre Boucher — contact@spboucher.ai3"""Step 01 — Build the estimation sample.45Reads the raw matched transaction–roll snapshot6(``data/raw/transactions_700k_avec_registre_foncier.parquet``), keeps7residential arm's-length sales with a high-confidence roll match, constructs8the assessment ratio and derived regressors, applies the trims, and writes9``data/processed/analysis.parquet``.1011Usage: python scripts/01_build_sample.py12"""13import sys14from pathlib import Path1516sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))1718from wp10 import sample # noqa: E402192021def main() -> None:22 s = sample.build_and_save()23 print(f"\nEstimation sample written: {len(s):,} sales")24 print(f" municipalities : {s['muni'].nunique():,}")25 print(f" cells : {s['cell'].nunique():,}")26 print(f" classes : {s.groupby('prop_class').size().to_dict()}")27 print(f" median ratio : {s['ratio'].median():.3f}")282930if __name__ == "__main__":31 main()32