re-added dropping of columns and changed default floor height to 2.4

This commit is contained in:
Khalim Conn-Kowlessar 2024-11-05 14:33:01 +00:00
parent a7aecb2462
commit 4443f1aa4b

View file

@ -111,6 +111,33 @@ def filter_and_prepare_epcs(epcs):
def rename_and_add_columns(epcs):
# Retrieve just the data we need
epcs = epcs[
[
"uprn",
"address",
"postcode",
"property-type",
"built-form",
"inspection-date",
"current-energy-rating",
"current-energy-efficiency",
"roof-description",
"walls-description",
"transaction-type",
# New fields needed
"secondheat-description",
"total-floor-area",
"construction-age-band",
"floor-height",
"number-habitable-rooms",
"mainheat-description",
#
"energy-consumption-current", # kwh/m2
"tenure"
]
]
epcs = epcs.rename(
columns={
"address": "Address",
@ -151,7 +178,7 @@ def rename_and_add_columns(epcs):
epcs["Estimated Heat Loss Perimeter (m2)"] = epcs.apply(
lambda x: estimate_external_wall_area(
x["Estimated Number of Floors"],
float(x["Property Floor Height"]) if x["Property Floor Height"] else 2.5,
float(x["Property Floor Height"]) if x["Property Floor Height"] else 2.4,
x["Estimated Perimeter (m)"],
x["Archetype"]
), axis=1