Skip to content

Commit

Permalink
Ingest new groups
Browse files Browse the repository at this point in the history
  • Loading branch information
wagnerlmichael committed Jan 23, 2024
1 parent 86a8bd0 commit 2a8540c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Binary file added QC_salesval_nbhds_round2.xlsx
Binary file not shown.
11 changes: 10 additions & 1 deletion manual_flagging/initial_flagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
sale.doc_no AS meta_sale_document_num,
sale.seller_name AS meta_sale_seller_name,
sale.buyer_name AS meta_sale_buyer_name,
sale.nbhd as nbhd,
sale.sale_filter_ptax_flag AS ptax_flag_original,
data.class,
data.township_code,
Expand Down Expand Up @@ -145,12 +146,20 @@
if tri in inputs["run_tri"]
}

# Create age column if we will need it later on
# Handle current methodology data manipulation if needed
if "current" in tri_stat_groups.values():
# Calculate the building's age
current_year = datetime.datetime.now().year
df["bldg_age"] = current_year - df["yrblt"]

# Ingest new geographic groups
df_new_groups = pd.read_excel(
os.path.join(root, "QC_salesval_nbhds_round2.xlsx"),
usecols=["Town Nbhd", "Town Grp 1"],
).rename(columns={"Town Nbhd": "nbhd", "Town Grp 1": "geography_split"})

df = pd.merge(df, df_new_groups, on="nbhd", how="left")


dfs_to_feature_creation = {} # Dictionary to store DataFrames

Expand Down

0 comments on commit 2a8540c

Please sign in to comment.