<jupyter_start><jupyter_text>This work was inspired by [<NAME>'s](https://www.researchgate.net/profile/Ciara_Ahern) work on BER Default values.  Load BERPublicsearch- Downloaded on October 2020 from SEAI at https://ndber.seai.ie/BERResearchTool/Register/Register.aspx - Columns `Year_of_Construction`, `UValueWall` and `FirstWallType_Description` were extracted- Data was saved as a `csv`, compressed into a `zip` file and uploaded to this repository at: https://github.com/codema-dev/berpublicsearch-defaults/tree/main/data<jupyter_code>ber = pd.read_csv("../data/BERPublicsearch.zip")
ber<jupyter_output><empty_output><jupyter_text>Bin individual buildings into the SEAI-specified age bands- `age_bands` and `wall_uvalues` tables from [DEAP Manual 4.2.2 Appendix S](https://www.seai.ie/home-energy/building-energy-rating-ber/support-for-ber-assessors/domestic-ber-resources/) were copied into `csv` files and uploaded to this repository at: https://github.com/codema-dev/berpublicsearch-defaults/tree/main/data<jupyter_code>age_bands = pd.read_csv("../data/age-bands.csv")
age_bands
ber["age_band_bin"] = pd.cut(
    ber["Year_of_Construction"],
    bins=[-np.inf, 1900, 1929, 1949, 1966, 1977, 1982, 1993, 1999, 2004, 2009, np.inf],
)
age_band_bins = [age_band_bin for age_band_bin in ber["age_band_bin"].unique().sort_values()]
age_bands = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K"]
age_band_map = {age_band_bin: age_band  for age_band, age_band_bin in zip(age_bands, age_band_bins)}
ber["age_band"] = ber["age_band_bin"].map(age_band_map)
ber["age_band"]<jupyter_output><empty_output><jupyter_text>Link each building to it's default wall U-value<jupyter_code>wall_defaults_raw = pd.read_csv("../data/wall-uvalues.csv")
wall_defaults_raw
wall_defaults_pivoted = wall_defaults_raw.copy().melt(
    id_vars="Wall type",
    var_name="age_band",
    value_vars=age_bands,
    value_name="UValueWall_default"
)
wall_defaults_pivoted["wall_type"] = wall_defaults_pivoted["Wall type"].str.lower()
wall_defaults = wall_defaults_pivoted
wall_defaults
ber["FirstWallType_Description"].unique()
ber["wall_type"] = ber["FirstWallType_Description"].fillna("Unknown").replace({"Other": "Unknown"}).str.lower()
ber["wall_type"].unique()
ber
ber_merged = ber[["age_band", "wall_type", "UValueWall"]].merge(wall_defaults[["age_band", "wall_type", "UValueWall_default"]])
ber_merged["UValueWall_is_default"] = ber_merged["UValueWall"] == ber_merged["UValueWall_default"]
ber_uvalue_wall_is_default = ber_merged.query("`UValueWall_is_default` == True")
ber_uvalue_wall_is_default
number_of_uvalue_wall_default_hh = len(ber_uvalue_wall_is_default)
number_of_hh = len(ber)
percentage_of_uvalue_wall_default_hh = round(number_of_uvalue_wall_default_hh / number_of_hh * 100, 2)
display(f"{percentage_of_uvalue_wall_default_hh}% of Dublin BERPublicsearch hh use default values for walls")<jupyter_output><empty_output><jupyter_text>(Optional) Download BER default-linked data<jupyter_code>from IPython.display import FileLink
output_filepath = "../data/BERPublicsearch_with_default_uvaluewall.csv"
ber_merged.to_csv(output_filepath)
display(f"Click to download the default-linked data")
FileLink(output_filepath)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13597033374536466, 'fraction_numerical': 0.0157601977750309, 'mean_word_length': 7.917355371900826, 'pattern_counts': {'":': 1, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '331348', 'license': 'MIT', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1125, 'n_words': 201, 'path': 'notebooks/count_berpublicsearch_uvaluewall_defaults.ipynb', 'repo_name': 'codema-dev/berpublicsearch-defaults', 'size': '3241'}