From 8e65ac05cf715a4cc9ad2be227b3994cb95ce7b9 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 3 Jul 2023 18:31:49 +0100 Subject: [PATCH] fixed minor bug which commented out the averages cleaning --- model_data/EpcClean.py | 5 +++++ model_data/epc_attributes/LightingAttributes.py | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/model_data/EpcClean.py b/model_data/EpcClean.py index 3071e635..1bf8589d 100644 --- a/model_data/EpcClean.py +++ b/model_data/EpcClean.py @@ -3,6 +3,7 @@ from collections import Counter import pandas as pd +from model_data.utils import correct_spelling from model_data.epc_attributes.FloorAttributes import FloorAttributes from model_data.epc_attributes.HotWaterAttributes import HotWaterAttributes from model_data.epc_attributes.MainFuelAttributes import MainFuelAttributes @@ -66,6 +67,10 @@ class EpcClean: averages = aggs.groupby("lighting-description")["low-energy-lighting"].mean().reset_index() averages["lighting-description"] = averages["lighting-description"].str.lower() + + # Correct spelling mistakes in averages + averages["lighting-description"] = averages["lighting-description"].apply(correct_spelling) + return averages def clean(self) -> None: diff --git a/model_data/epc_attributes/LightingAttributes.py b/model_data/epc_attributes/LightingAttributes.py index f0dd6ef4..62aa7e46 100644 --- a/model_data/epc_attributes/LightingAttributes.py +++ b/model_data/epc_attributes/LightingAttributes.py @@ -9,8 +9,6 @@ class LightingAttributes: self.description: str = clean_description(description.lower()) self.description = correct_spelling(self.description) self.averages = averages - # Correct spelling mistakes in averages - # self.averages["lighting-description"] = self.averages["lighting-description"].apply(correct_spelling) def process(self):