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 7481724b..b954a651 100644 --- a/etl/eligibility/ha_15_32/ha_analysis_batch_3.py +++ b/etl/eligibility/ha_15_32/ha_analysis_batch_3.py @@ -887,6 +887,27 @@ class DataLoader: def correct_ha28_survey_list(survey_list): # Rename the "No" column to "No." to align with the other survey sheets survey_list = survey_list.rename(columns={"NO ": "NO."}) + + survey_list["Post Code"] = np.where( + survey_list["Post Code"] == "ME75HA", + "ME7 5HA", + survey_list["Post Code"] + ) + + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "ANDREW MANOR/BRITTON ST", "ANDREW MANOR" + ) + + survey_list["Post Code"] = np.where( + survey_list["Post Code"] == "ME75TW", + "ME7 5TW", + survey_list["Post Code"] + ) + + survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace( + "ST MARKS HOUSE/SAXON ST", "ST MARKS HOUSE" + ) + return survey_list @staticmethod @@ -1046,7 +1067,7 @@ class DataLoader: asset_list["matching_address"].str.contains(row["Street / Block Name"].lower().strip()) ].copy() - if str(house_number) not in df["matching_address"].values: + if not any(df["matching_address"].str.contains(str(house_number))): if "flat" in str(house_number): house_number = house_number.split("flat")[1].strip()