mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Added in the re-labelling of assets based on eco3 merge
This commit is contained in:
parent
961b53d523
commit
7f88f0e0f5
1 changed files with 20 additions and 0 deletions
|
|
@ -1812,6 +1812,7 @@ class DataLoader:
|
|||
asset_list = data_assets["asset_list"].copy()
|
||||
survey_list = data_assets["survey_list"].copy()
|
||||
ciga_list = data_assets["ciga_list"].copy()
|
||||
eco3_list = data_assets.get("eco3_list", pd.DataFrame())
|
||||
|
||||
asset_list_starting_size = asset_list.shape[0]
|
||||
|
||||
|
|
@ -1859,6 +1860,25 @@ class DataLoader:
|
|||
if asset_list.shape[0] != asset_list_starting_size:
|
||||
raise ValueError("The asset list has changed in size")
|
||||
|
||||
# If we have eco3 surveys, we set a property to not eligible
|
||||
if not eco3_list.empty:
|
||||
eco3_list_to_merge = eco3_list[["asset_list_row_id"]].copy()
|
||||
eco3_list_to_merge["has_eco3"] = True
|
||||
asset_list = asset_list.merge(
|
||||
eco3_list_to_merge, how="left", on="asset_list_row_id"
|
||||
)
|
||||
|
||||
if asset_list.shape[0] != asset_list_starting_size:
|
||||
raise ValueError("The asset list has changed in size, when merging on eco3")
|
||||
|
||||
# Any rows that have an eco3 survey are set to not eligible
|
||||
asset_list["ECO Eligibility"] = np.where(
|
||||
asset_list["has_eco3"] == True,
|
||||
"not eligible",
|
||||
asset_list["ECO Eligibility"]
|
||||
)
|
||||
asset_list = asset_list.drop(columns=["has_eco3"])
|
||||
|
||||
# Report on sales
|
||||
sales_report = {}
|
||||
if not survey_list.empty:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue