This commit is contained in:
Andras Schmelczer 2026-02-07 19:13:36 +00:00
parent 555ba7cf53
commit 3c2e527328
6 changed files with 64 additions and 26 deletions

View file

@ -10,7 +10,11 @@ def transform_crime(crime_dir: Path, output_path: Path) -> None:
df = pl.scan_csv(
csvs,
schema_overrides={"LSOA code": pl.Utf8, "Crime type": pl.Utf8, "Month": pl.Utf8},
schema_overrides={
"LSOA code": pl.Utf8,
"Crime type": pl.Utf8,
"Month": pl.Utf8,
},
).select("LSOA code", "Crime type", "Month")
# Extract year, count crimes per LSOA / year / crime type