mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
completed load_data, setup app and get_epc_data
This commit is contained in:
parent
02dc1241fb
commit
8a27daf71b
1 changed files with 35 additions and 0 deletions
|
|
@ -157,3 +157,38 @@ def load_data():
|
|||
"survey_status": row["INSTALLED OR CANCELLED"]
|
||||
}
|
||||
)
|
||||
|
||||
matched = pd.DataFrame(matched)
|
||||
matched["warmfront_identified"] = True
|
||||
|
||||
# Combine asset list and surveys
|
||||
data = asset_list.merge(
|
||||
matched, how="left", left_on="Address", right_on="matched_address",
|
||||
)
|
||||
data["warmfront_identified"] = data["warmfront_identified"].fillna(False)
|
||||
|
||||
return data, survey_list
|
||||
|
||||
|
||||
def get_epc_data(data, cleaned, cleaning_data, created_at):
|
||||
pass
|
||||
|
||||
|
||||
def app():
|
||||
data, survey_list = load_data()
|
||||
|
||||
data["row_id"] = ["ha16_" + str(i) for i in range(0, len(data))]
|
||||
|
||||
cleaned = read_from_s3(
|
||||
s3_file_name="cleaned_epc_data/cleaned.bson",
|
||||
bucket_name="retrofit-data-dev"
|
||||
)
|
||||
cleaned = msgpack.unpackb(cleaned, raw=False)
|
||||
|
||||
cleaning_data = read_parquet_from_s3(
|
||||
bucket_name="retrofit-data-dev", file_key="sap_change_model/cleaning_dataset.parquet",
|
||||
)
|
||||
|
||||
created_at = datetime.now().isoformat()
|
||||
|
||||
results_df, scoring_data, nodata = get_epc_data(data, cleaned, cleaning_data, created_at)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue