From 02dc1241fbf26ddabd47d56e366dd17152341ac8 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 27 Dec 2023 15:03:36 +0000 Subject: [PATCH] completed matched for ha24 --- etl/eligibility/ha_15_32/ha24_app.py | 34 ++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/etl/eligibility/ha_15_32/ha24_app.py b/etl/eligibility/ha_15_32/ha24_app.py index 3b4db9ca..a85ff5cf 100644 --- a/etl/eligibility/ha_15_32/ha24_app.py +++ b/etl/eligibility/ha_15_32/ha24_app.py @@ -93,11 +93,38 @@ def load_data(): survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.strip() survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( - "Council House/Nidds Lane", "NIDDS LANE" + "council house, nidds lane", "nidds lane" + ) + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "wirral avenue", "wirrall avenue" + ) + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "st ives road", "st. ives crescent" + ) + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "sundringham road", "sandringham road" + ) + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "milton avenue", "milton road" + ) + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "st ives crescent", "st. ives crescent" + ) + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "council house, waterbelly lane", "waterbelly lane" + ) + # Generally remove "councile house, " from the start of the street name + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "council house, ", "" + ) + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "st. leodegars close", "st leodegars close" ) + # asset_list[asset_list["Address"].str.lower().str.contains("wirral")]["Address"] + # Drop all None rows - survey_list = survey_list.dropna(how='all') + survey_list = survey_list[~pd.isnull(survey_list["Street / Block Name"])] survey_list["survey_key"] = ["survey_" + str(i) for i in range(0, len(survey_list))] matched = [] @@ -115,6 +142,9 @@ def load_data(): if df.shape[0] != 1: df = df[df["Postcode"].str.lower().str.contains(row["Post Code"].lower())] if df.shape[0] != 1: + print(row["Street / Block Name"]) + print(house_number) + print(row["Post Code"].lower()) raise ValueError("Investigate") matched.append(