mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Done HA52
This commit is contained in:
parent
e7cd80eba0
commit
e6c9dd7074
1 changed files with 33 additions and 4 deletions
|
|
@ -503,6 +503,10 @@ class DataLoader:
|
|||
"address": "Property Address Full",
|
||||
"postcode": "Property Postcode"
|
||||
},
|
||||
"HA52": {
|
||||
"address": "Postal Address",
|
||||
"postcode": "POSTCODE"
|
||||
},
|
||||
"HA54": {
|
||||
"address": "Postal Address",
|
||||
"postcode": "matching_postcode"
|
||||
|
|
@ -523,7 +527,8 @@ class DataLoader:
|
|||
"HA63": 15,
|
||||
"HA107": 51,
|
||||
"HA48": 0,
|
||||
"HA45": 0
|
||||
"HA45": 0,
|
||||
"HA52": 5
|
||||
}
|
||||
|
||||
UNMATCHED_ECO3 = {
|
||||
|
|
@ -548,7 +553,7 @@ class DataLoader:
|
|||
|
||||
def create_asset_list_matching_address(self, ha_name, asset_list):
|
||||
|
||||
if ha_name in ["HA1", "HA6", "HA12", "HA16", "HA24", "HA30", "HA31", "HA45", "HA48", "HA49", "HA54"]:
|
||||
if ha_name in ["HA1", "HA6", "HA12", "HA16", "HA24", "HA30", "HA31", "HA45", "HA48", "HA49", "HA52", "HA54"]:
|
||||
asset_list["matching_address"] = asset_list[
|
||||
self.COLUMN_CONFIG[ha_name]["address"]
|
||||
].astype(str).str.lower().str.strip()
|
||||
|
|
@ -2531,6 +2536,25 @@ class DataLoader:
|
|||
|
||||
return survey_list
|
||||
|
||||
@staticmethod
|
||||
def correct_ha52_survey_list(survey_list):
|
||||
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
|
||||
"Mardalle Avenue", "Mardale Avenue"
|
||||
)
|
||||
|
||||
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
|
||||
"Ollerton Close, Grappenhall", "Ollerton Close"
|
||||
)
|
||||
|
||||
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
|
||||
"Bradshaw Road, Grappenhall", "Bradshaw Lane"
|
||||
)
|
||||
|
||||
# Drop a bunch of dupes
|
||||
survey_list = survey_list.drop_duplicates(["NO.", "Street / Block Name", "Post Code"])
|
||||
|
||||
return survey_list
|
||||
|
||||
@staticmethod
|
||||
def levenstein_match(matching_string, df):
|
||||
match_to = df["matching_address"].tolist()
|
||||
|
|
@ -3165,7 +3189,12 @@ class DataLoader:
|
|||
asset_list_starting_size = asset_list.shape[0]
|
||||
|
||||
# Change the column name if it's ECO eligibility
|
||||
asset_list = asset_list.rename(columns={"ECO eligibility": "ECO Eligibility"})
|
||||
asset_list = asset_list.rename(
|
||||
columns={
|
||||
"ECO eligibility": "ECO Eligibility",
|
||||
"ECO Eligibilty": "ECO Eligibility",
|
||||
},
|
||||
)
|
||||
# Remove surplus whitespace from the ECO Eligibility column
|
||||
asset_list["ECO Eligibility"] = asset_list["ECO Eligibility"].str.strip()
|
||||
# Push to lower case
|
||||
|
|
@ -6286,7 +6315,7 @@ def app():
|
|||
"HA27", "HA28", "HA30", "HA31", "HA32", "HA34", "HA35", "HA39", "HA41", "HA48", "HA49", "HA50", "HA54", "HA56",
|
||||
"HA63", "HA107", "HA117", "HA8", "HA11", "HA21", "HA37", "HA42",
|
||||
# Added as of March 18th
|
||||
"HA44", "HA45", "HA51",
|
||||
"HA44", "HA45", "HA51", "HA52",
|
||||
# New HAS
|
||||
"HAXX", "HAXXX",
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue