mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
handling genuine dual leasehold ownership
This commit is contained in:
parent
cce9c64fdc
commit
76ef5c897a
1 changed files with 5 additions and 3 deletions
|
|
@ -42,6 +42,7 @@ def app():
|
|||
|
||||
freehold_matching_lookup = []
|
||||
leasehold_matching_lookup = []
|
||||
shared_leasehold_match = []
|
||||
for _, address in tqdm(properties.iterrows(), total=len(properties)):
|
||||
filtered = company_ownership[
|
||||
company_ownership["Postcode"].str.lower() == address["POSTCODE"].lower()
|
||||
|
|
@ -62,9 +63,10 @@ def app():
|
|||
raise ValueError("Multiple freehold matches")
|
||||
|
||||
if filtered_leasehold.shape[0] > 1:
|
||||
raise ValueError("Multiple leasehold matches")
|
||||
|
||||
if not filtered_leasehold.empty:
|
||||
matched = filtered_leasehold[["Title Number"]].copy()
|
||||
matched.insert(0, "UPRN", address["UPRN"])
|
||||
shared_leasehold_match.append(matched)
|
||||
elif not filtered_leasehold.empty:
|
||||
leasehold_matching_lookup.append(
|
||||
{
|
||||
"UPRN": address["UPRN"],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue