completed matched for ha24

This commit is contained in:
Khalim Conn-Kowlessar 2023-12-27 15:03:36 +00:00
parent 25684622f9
commit 02dc1241fb

View file

@ -93,11 +93,38 @@ def load_data():
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.strip()
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
"Council House/Nidds Lane", "NIDDS LANE"
"council house, nidds lane", "nidds lane"
)
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
"wirral avenue", "wirrall avenue"
)
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
"st ives road", "st. ives crescent"
)
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
"sundringham road", "sandringham road"
)
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
"milton avenue", "milton road"
)
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
"st ives crescent", "st. ives crescent"
)
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
"council house, waterbelly lane", "waterbelly lane"
)
# Generally remove "councile house, " from the start of the street name
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
"council house, ", ""
)
survey_list["Street / Block Name"] = survey_list["Street / Block Name"].str.replace(
"st. leodegars close", "st leodegars close"
)
# asset_list[asset_list["Address"].str.lower().str.contains("wirral")]["Address"]
# Drop all None rows
survey_list = survey_list.dropna(how='all')
survey_list = survey_list[~pd.isnull(survey_list["Street / Block Name"])]
survey_list["survey_key"] = ["survey_" + str(i) for i in range(0, len(survey_list))]
matched = []
@ -115,6 +142,9 @@ def load_data():
if df.shape[0] != 1:
df = df[df["Postcode"].str.lower().str.contains(row["Post Code"].lower())]
if df.shape[0] != 1:
print(row["Street / Block Name"])
print(house_number)
print(row["Post Code"].lower())
raise ValueError("Investigate")
matched.append(