Scipy and Rpy for Analysis of Public Procurement Purchases
summary
Aggregates ~28,000 nonconformant XML procurement records into a Postgres database (≈500k rows, €3B total, ~70k suppliers) using a forgiving XML import (GenPie “bag”) and cleaning steps. Uses SciPy (percentile_of_score) for Pareto-style analysis producing ~250k-row queries and calls R via rpy2 reading directly from Postgres to produce complex plots; multiprocessing reduced runtime from ~7 to ~4 minutes but rpy2 multiprocessing failed. Findings: in universities ~75% of purchases are under €2,000, ~80% of suppliers appear only once, and clustering reveals distinct supplier/behavior groups not correlated with size or region.
AI-written summary · about
