mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
apartment string match
This commit is contained in:
parent
b63ab89e89
commit
e85936ae97
1 changed files with 8 additions and 0 deletions
|
|
@ -691,6 +691,7 @@ def app():
|
|||
)
|
||||
# We check if we have a flat
|
||||
match_flat_number = re.match("flat (\d+)", match["epc_address1"].lower())
|
||||
match_apartment_number = re.match("apartment (\d+)", match["epc_address1"].lower())
|
||||
lr_filtered["saon_match3"] = False
|
||||
if match_flat_number is not None:
|
||||
# Get out the match
|
||||
|
|
@ -699,6 +700,13 @@ def app():
|
|||
lambda x: False if pd.isnull(x) else x == match_flat_number
|
||||
)
|
||||
|
||||
if match_apartment_number is not None:
|
||||
# Get out the match
|
||||
match_apartment_number = "apartment " + match_apartment_number.group(1)
|
||||
lr_filtered["saon_match3"] = lr_filtered["saon"].apply(
|
||||
lambda x: False if pd.isnull(x) else x == match_apartment_number
|
||||
)
|
||||
|
||||
if all_paon_equal and all_saon_equal and all_street_equal:
|
||||
# Take the newest record
|
||||
lr_filtered = lr_filtered.sort_values("date_of_transfer", ascending=False)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue