From 72a4feb6af3967dc6ce00bb4df7d7d47c4772dc1 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 28 Mar 2024 17:18:08 +0000 Subject: [PATCH] minor tweak to asset list to make uprn int --- etl/customers/gla_croydon_demo/asset_list.py | 8 ++++++-- etl/customers/gla_croydon_demo/slides.py | 0 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 etl/customers/gla_croydon_demo/slides.py diff --git a/etl/customers/gla_croydon_demo/asset_list.py b/etl/customers/gla_croydon_demo/asset_list.py index 526c34a0..01220d0a 100644 --- a/etl/customers/gla_croydon_demo/asset_list.py +++ b/etl/customers/gla_croydon_demo/asset_list.py @@ -36,7 +36,7 @@ def app(): epc_data["CURRENT_ENERGY_RATING"].value_counts(normalize=True) # For the purpose of the sample, take the properties have surveys done in the last 2 years - # This gives us 1023 remaining properties + # This gives us 1167 remaining properties two_years_ago = pd.Timestamp.now() - pd.DateOffset(days=int(2.5 * 365)) epc_data = epc_data[epc_data["LODGEMENT_DATE"] >= two_years_ago] @@ -45,7 +45,7 @@ def app(): # 2) Unfilled cavity # 3) A roof that could be insulated (flat or pitched with no more than 50mm insulation) # 4) EPC E - # Different buckets of properties + # 12 properties archetype_1_sample = epc_data[ epc_data["PROPERTY_TYPE"].isin(["House"]) & (epc_data["CURRENT_ENERGY_RATING"] == "E") & @@ -69,6 +69,7 @@ def app(): # 2) Unfilled cavity # 3) Another property above # 4) EPC E + # 14 properties here archetype_2_sample = epc_data[ epc_data["PROPERTY_TYPE"].isin(["Flat"]) & (epc_data["CURRENT_ENERGY_RATING"] == "E") & @@ -108,6 +109,7 @@ def app(): archetype_4_sample_asset_list = archetype_4_sample[["UPRN", "ADDRESS1", "POSTCODE"]].copy() archetype_4_sample_asset_list["ARCHETYPE"] = "Archetype 4" + # 41 total properties asset_list = pd.concat( [ archetype_1_sample_asset_list, @@ -126,6 +128,8 @@ def app(): } ) + asset_list["uprn"] = asset_list["uprn"].astype(int) + filename = f"{USER_ID}/{PORTFOLIO_ID}/inputs.csv" save_csv_to_s3( dataframe=asset_list, diff --git a/etl/customers/gla_croydon_demo/slides.py b/etl/customers/gla_croydon_demo/slides.py new file mode 100644 index 00000000..e69de29b