mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Added ciga list id
This commit is contained in:
parent
615f2289e7
commit
a1b2f9bf5b
1 changed files with 15 additions and 9 deletions
|
|
@ -195,6 +195,7 @@ class DataLoader:
|
||||||
ciga_list = pd.DataFrame(ciga_rows, columns=[cell.value for cell in ciga_sheet[1]])
|
ciga_list = pd.DataFrame(ciga_rows, columns=[cell.value for cell in ciga_sheet[1]])
|
||||||
# Remove columns that are None
|
# Remove columns that are None
|
||||||
ciga_list = ciga_list.loc[:, ciga_list.columns.notnull()]
|
ciga_list = ciga_list.loc[:, ciga_list.columns.notnull()]
|
||||||
|
survey_list["survey_list_row_id"] = [ha_name + "_ciga_" + str(i) for i in range(0, len(survey_list))]
|
||||||
# Perform ciga list merge
|
# Perform ciga list merge
|
||||||
if not ciga_list.empty:
|
if not ciga_list.empty:
|
||||||
ciga_list = self.create_ciga_list_house_no(ha_name, ciga_list)
|
ciga_list = self.create_ciga_list_house_no(ha_name, ciga_list)
|
||||||
|
|
@ -440,14 +441,14 @@ class DataLoader:
|
||||||
df = df[df["matching_postcode"].str.lower().str.contains(row["Post Code"].lower())]
|
df = df[df["matching_postcode"].str.lower().str.contains(row["Post Code"].lower())]
|
||||||
if df.shape[0] != 1:
|
if df.shape[0] != 1:
|
||||||
postcode_lower = row["Post Code"].lower()
|
postcode_lower = row["Post Code"].lower()
|
||||||
if postcode_lower in missed_postcodes:
|
# if postcode_lower in missed_postcodes:
|
||||||
matching_lookup.append(
|
# matching_lookup.append(
|
||||||
{
|
# {
|
||||||
"survey_list_row_id": row["survey_list_row_id"],
|
# "survey_list_row_id": row["survey_list_row_id"],
|
||||||
"asset_list_row_id": None,
|
# "asset_list_row_id": None,
|
||||||
}
|
# }
|
||||||
)
|
# )
|
||||||
continue
|
# continue
|
||||||
|
|
||||||
print(row["Street / Block Name"])
|
print(row["Street / Block Name"])
|
||||||
print(house_number)
|
print(house_number)
|
||||||
|
|
@ -456,13 +457,18 @@ class DataLoader:
|
||||||
|
|
||||||
matching_lookup.append(
|
matching_lookup.append(
|
||||||
{
|
{
|
||||||
"survey_list_row_id": row["survey_list_row_id"],
|
"ciga_list_row_id": row["ciga_list_row_id"],
|
||||||
"asset_list_row_id": df["asset_list_row_id"].values[0],
|
"asset_list_row_id": df["asset_list_row_id"].values[0],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
matching_lookup = pd.DataFrame(matching_lookup)
|
matching_lookup = pd.DataFrame(matching_lookup)
|
||||||
|
|
||||||
|
# Merge onto the ciga list
|
||||||
|
ciga_list = ciga_list.merge(matching_lookup, how='left', on="ciga_list_row_id")
|
||||||
|
|
||||||
|
return ciga_list
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def identify_built_form_ha6(property_string):
|
def identify_built_form_ha6(property_string):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue