adding HA15

This commit is contained in:
Khalim Conn-Kowlessar 2024-03-02 12:54:19 +00:00
parent fc022b8a22
commit 9a69f8741e

View file

@ -165,6 +165,7 @@ class DataLoader:
UNMATCHED_CIGA = {
"HA6": 117,
"HA14": 3,
"HA15": 3,
"HA16": 7,
"HA24": 12,
"HA107": 51,
@ -204,7 +205,15 @@ class DataLoader:
asset_list["Address 4"].astype(str).str.lower().str.strip() + ", " + \
asset_list["Postcode"].astype(str).str.lower().str.strip()
asset_list["matching_postcode"] = asset_list["Postcode"].astype(str).str.lower().str.strip()
elif ha_name == "HA15":
asset_list["matching_address"] = (
asset_list["Address Line 1"].astype(str).str.lower().str.strip() + ", " +
asset_list["Address Line 2"].astype(str).str.lower().str.strip() + ", " +
asset_list["Address Line 3"].astype(str).str.lower().str.strip() + ", " +
asset_list["Address Line 4"].astype(str).str.lower().str.strip() + ", " +
asset_list["Postcode"].astype(str).str.lower().str.strip()
)
asset_list["matching_postcode"] = asset_list["Postcode"].astype(str).str.lower().str.strip()
elif ha_name == "HA39":
# Create matching_address by concatenating add_1, add_2, add_3, add_4, add_5, post_code
asset_list["matching_address"] = asset_list["add_1"].astype(str).str.lower().str.strip() + ", " + \
@ -502,6 +511,15 @@ class DataLoader:
return asset_list
@staticmethod
def correct_ha15_asset_list(asset_list):
asset_list["matching_postcode"] = np.where(
asset_list["Address Line 1"] == "103 Priory Crescent",
"hp19 9ny",
asset_list["matching_postcode"]
)
return asset_list
@staticmethod
def correct_ha6_survey_list(survey_list):
@ -655,6 +673,14 @@ class DataLoader:
return survey_list
@staticmethod
def correct_ha15_survey_list(survey_list):
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
"Mary Mac Manus Drive, Milton Keynes", "Mary Mac Manus Drive"
)
return survey_list
@staticmethod
def correct_ha16_survey_list(survey_list):
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace("/", ", ")
@ -3320,7 +3346,9 @@ def app():
# Grab the December HA figures filepath
december_figures_filepath = "local_data/ha_data/HA_December_figures.csv"
priority_has = ["HA1", "HA6", "HA7", "HA14", "HA16", "HA24", "HA25", "HA39", "HA107"]
priority_has = [
"HA1", "HA6", "HA7", "HA14", "HA15", "HA16", "HA24", "HA25", "HA39", "HA107"
]
# Next HAs to do: 15, 32, 33,
# Then: 28, 41, 38, 10, 14, 20, 48
# Filter down the directories to only the priority HAs