mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
fixed missed cases and completed merge between assets and surveys
This commit is contained in:
parent
8f38996391
commit
e6a25ab7be
1 changed files with 20 additions and 4 deletions
|
|
@ -193,6 +193,10 @@ def load_data():
|
|||
"grasmere avenue, wardley")
|
||||
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace("mardale avenue wardle",
|
||||
"mardale avenue, wardle")
|
||||
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace("carleach grove",
|
||||
"cartleach Grove")
|
||||
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace("arbour grove",
|
||||
"arbor Grove")
|
||||
|
||||
# Replacement for clively avenue 66-68
|
||||
survey_list["NO."] = np.where(
|
||||
|
|
@ -208,9 +212,6 @@ def load_data():
|
|||
matched = []
|
||||
for _, row in tqdm(survey_list.iterrows(), total=len(survey_list)):
|
||||
|
||||
if row["Street / Block Name"] in ["carleach grove", "arbour grove"]:
|
||||
continue
|
||||
|
||||
house_number = row["NO."]
|
||||
if isinstance(house_number, str):
|
||||
house_number = house_number.lower()
|
||||
|
|
@ -229,6 +230,21 @@ def load_data():
|
|||
matched.append(
|
||||
{
|
||||
"survey_key": row["survey_key"],
|
||||
"matched_address": df["Address"].values[0]
|
||||
"matched_address": df["Address"].values[0],
|
||||
"survey_house_no": row["NO."],
|
||||
"survey_street_name": row["Street / Block Name"],
|
||||
"survey_postcode": row["Post Code"],
|
||||
"survey_status": row["INSTALLED OR CANCELLED"]
|
||||
}
|
||||
)
|
||||
|
||||
matched = pd.DataFrame(matched)
|
||||
matched["warmfront_identified"] = True
|
||||
|
||||
# Combine asset list and surveys
|
||||
data = asset_list.merge(
|
||||
matched, how="left", left_on="Address", right_on="matched_address",
|
||||
)
|
||||
data["warmfront_identified"] = data["warmfront_identified"].fillna(False)
|
||||
|
||||
return data
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue