mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
commit
0e8b520f2b
2 changed files with 20 additions and 10 deletions
|
|
@ -843,7 +843,7 @@ class Property:
|
||||||
raise ValueError("Current energy bill has not been set")
|
raise ValueError("Current energy bill has not been set")
|
||||||
|
|
||||||
# IF we have a SAP05 overwrite, we pull out the relevant information
|
# IF we have a SAP05 overwrite, we pull out the relevant information
|
||||||
sap_05_overwritten = self.data.get("sap_05_overwritten", False)
|
sap_05_overwritten = self.data.get("sap-05-overwritten", False)
|
||||||
|
|
||||||
sap_05_score, sap_05_epc_rating = None, None
|
sap_05_score, sap_05_epc_rating = None, None
|
||||||
if sap_05_overwritten:
|
if sap_05_overwritten:
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ modelling_data["landlord_property_id"] = sustainability_data["Org Ref"].copy()
|
||||||
modelling_data["domna_property_id"] = sustainability_data["Org Ref"].copy()
|
modelling_data["domna_property_id"] = sustainability_data["Org Ref"].copy()
|
||||||
|
|
||||||
modelling_data = modelling_data.rename(
|
modelling_data = modelling_data.rename(
|
||||||
{
|
columns={
|
||||||
"Address 1": "domna_address_1",
|
"Address 1": "domna_address_1",
|
||||||
"Postcode": "postcode",
|
"Postcode": "postcode",
|
||||||
"Type": "landlord_property_type",
|
"Type": "landlord_property_type",
|
||||||
|
|
@ -85,6 +85,15 @@ modelling_data = modelling_data.rename(
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def make_full_address(x):
|
||||||
|
to_join = [x['domna_address_1'], x['Address 2'], x['Address 3']]
|
||||||
|
to_join = [x for x in to_join if not pd.isnull(x) and x != '']
|
||||||
|
return ", ".join(to_join)
|
||||||
|
|
||||||
|
|
||||||
|
modelling_data["domna_full_address"] = modelling_data.apply(lambda x: make_full_address(x), axis=1)
|
||||||
|
|
||||||
modelling_data = modelling_data[
|
modelling_data = modelling_data[
|
||||||
[
|
[
|
||||||
"domna_address_1", "Address 2", "Address 3", "postcode", "landlord_property_type",
|
"domna_address_1", "Address 2", "Address 3", "postcode", "landlord_property_type",
|
||||||
|
|
@ -104,11 +113,12 @@ modelling_data["landlord_built_form"] = modelling_data["landlord_built_form"].ma
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
filename = ("/Users/khalimconn-kowlessar/Documents/hestia/Customers/Peabody/Nov 2025 Consulting Project/20251213 Model "
|
||||||
def make_full_address(x):
|
"data.xlsx")
|
||||||
to_join = [x['domna_address_1'], x['Address 2'], x['Address 3']]
|
with pd.ExcelWriter(filename) as writer:
|
||||||
to_join = [x for x in to_join if not pd.isnull(x) and x != '']
|
modelling_data.to_excel(writer, sheet_name="Standardised Asset List", index=False)
|
||||||
return ", ".join(to_join)
|
# Store the three sections
|
||||||
|
modelling_data[0:30000].to_excel(writer, sheet_name="Part 1", index=False)
|
||||||
|
modelling_data[30000:60000].to_excel(writer, sheet_name="Part 2", index=False)
|
||||||
modelling_data["domna_full_address"] = modelling_data.apply(lambda x: make_full_address(x), axis=1)
|
modelling_data[60000:].to_excel(writer, sheet_name="Part 3", index=False)
|
||||||
|
modelling_data.sample(60).to_excel(writer, sheet_name="Random testing sample", index=False)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue