From 067a66c1b172b63abc419a112525382ce7c2baa3 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Wed, 6 Mar 2024 22:45:22 +0000 Subject: [PATCH] ha38 wip - leaving for now --- .../ha_15_32/ha_analysis_batch_3.py | 54 ++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py index 567394a4..c4f6307c 100644 --- a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py +++ b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py @@ -599,7 +599,52 @@ class DataLoader: asset_list['ExtractedHouseNo'] = asset_list['matching_address'].apply(extract_house_no_if_flat) asset_list.loc[asset_list['ExtractedHouseNo'].notnull(), 'HouseNo'] = asset_list['ExtractedHouseNo'] asset_list['matching_address'] = asset_list['matching_address'].apply(rearrange_address_if_flat) - # We then need to + + # We update a few specific rows + asset_list["HouseNo"] = np.where( + (asset_list["Address_Line_1"].isin( + [ + "10 SOUTH VIEW/ROOM A1", + "10 SOUTH VIEW/ROOM A2", + "10 SOUTH VIEW/ROOM A3", + ] + )), + "10A", + asset_list["HouseNo"] + ) + + asset_list["matching_address"] = np.where( + (asset_list["Address_Line_1"].isin( + [ + "10 SOUTH VIEW/ROOM A1", + ] + )), + "10a, 10 south view/room a1, spennymoor, co. durham, dl16 7df'", + asset_list["matching_address"] + ) + + asset_list["HouseNo"] = np.where( + (asset_list["Address_Line_1"].isin( + [ + "10 SOUTH VIEW/ROOM B1", + "10 SOUTH VIEW/ROOM B2", + "10 SOUTH VIEW/ROOM B3", + "10 SOUTH VIEW/ROOM B4", + ] + )), + "10B", + asset_list["HouseNo"] + ) + + asset_list["matching_address"] = np.where( + (asset_list["Address_Line_1"].isin( + [ + "10 SOUTH VIEW/ROOM B1", + ] + )), + "10b, 10 south view/room b1, spennymoor, co. durham, dl16 7df", + asset_list["matching_address"] + ) return asset_list @@ -1147,6 +1192,13 @@ class DataLoader: survey_list["Post Code"] ) + survey_list["Street / Block Name"] = np.where( + (survey_list["Street / Block Name"] == "SOUTHVIEW") & + (survey_list["Post Code"] == "DL16 7DF"), + "SOUTH VIEW", + survey_list["Street / Block Name"] + ) + return survey_list @staticmethod